I have a very simple, straightforward use of ImageBasedHeightMap set up, but the second terrain texture used never seems to display properly. I have done this in the past, and it has worked without issue before, but this time it is weirding out. I even tried to copy/paste the heightmap part out of the hello terrain tutorial and modify to use my assets, but still no.
Right now I only have a grass texture and a dirt texture that I am using. Dirt is temporarily used for both textures 2 and 3.
In the screenshot, you can see that the grass shows up fine, but the dirt just looks solid light brown or tan. If I switch the textures around so that dirt is tex1 and grass is tex2, then the dirt shows up fine but the grass looks like a solid green.
As you can see from the following code, it’s basically just the Hello Terrain tutorial at the moment, so it should be fine.
Material terrainMaterial = new Material(assetManager, “Common/MatDefs/Terrain/Terrain.j3md”);
Texture grass = assetManager.loadTexture(“Models/grass.jpg”);
Texture dirt = assetManager.loadTexture(“Models/dirt.jpg”);
AbstractHeightMap heightmap = null;
Texture heightMapImage = assetManager.loadTexture(“Models/heightmap.png”);
heightmap = new ImageBasedHeightMap(ImageToAwt.convert(heightMapImage.getImage(), false, true, 0));
int patchSize = 65;
TerrainQuad terrain = new TerrainQuad(“my terrain”, patchSize, 1025, heightmap.getHeightMap());
terrain.setLocalTranslation(0, -100, 0);
terrain.setLocalScale(10f, 2f, 10f);