Different footstep sounds

Hey monkeys,
is there any way to play different footstep sound for concrete, grass etc.? I use a terrain with several textures painted onto it, so I would somehow have to get the texture of the terrain at the place where the player is. Are there any methods I can use?

Thanks for your help.

For a terrain, get the alphamap(s) get via imageraster the color of the pixel, then you know the material.

Oh thanks I didn’t know about ImageRaster. How would I get the alpha map of the terrain? And if I get the color of the pixel, how can I test if the texture contains it? Sorry for all these questions but I haven’t worked that much with JME’s terrains…


Well from the terrains material you can ge the alphamap(s)

based on the color values you know the material
eg read on map one is the first texture used.
So if you have a readish pixel and your first texture is a stonesurface, you know its a stone surface footstep.