Multi texturing a terrain


I would like to overlay a specific texture ontop of the ones created by ProceduralTextureGenerator and I need to know where can I find information on the settings of the combine functions and operations?

I am basically wanting my third texture to blend with the two generated ones based on the third textures alpha values. Or failing that to replace the other textures where the third one is not transparent.


Terrain directly suports two texture units, base and detail. To add more, you’d add another texture to unit 2 and copy the texture coordinates from the terrain’s texture coordinates 0 index to it’s 2 index. If that makes since:

terrainTextureState.setTexture(anotherTexture, 2);
terrain.copyTextureCoords(0, 2);

Something like that.