How can I use multiple textures in Terrain? [solved]

how can I use multiple textures in Terrain?
“Common/MatDefs/Terrain/Terrain.j3md” have only three Texture parameter!
I want to have some texture for horizontal and vertical roads , grass , farm back ground , mountains , and …

and if is there a way to paint multiple textures , so what about alpha map?
how should I change it? (RGBA)

where is the Terrain docs?
https://docs.jmonkeyengine.org/beginner/hello_terrain.html :anguished:

I dont like to use jme Terrain editor , I hate it .

Do you need lighting? If yes, you can use TerrainLighting.j3md

It has Texture2D DiffuseMap, DiffuseMap_1 all the way to DiffuseMap_11.

1 Like

and which colors for each DiffuseMap in alpha map?

would you mind to give a link to docs or tutorials about TerrainLighting.j3md? (I googled but nothing found!)

there are 3 alphamaps: m_AlphaMap, m_AlphaMap_1, m_AlphaMap_2.
So for first four textures you got the first alphamap.rgba components in that order, then next alpha map, another 4 textures etc.

PS: I don’t have a link to a docs, but you can take a look, for example at the material definition or the fragment shader: jmonkeyengine/TerrainLighting.frag at 445f7ed010199d30c484fe75bacef4b87f2eb38e · jMonkeyEngine/jmonkeyengine · GitHub

1 Like

This link might help:
https://jmonkeyengine.github.io/wiki/jme3/advanced/terrain.html#toolbar

1 Like