Hi, I am working on a world generation with simulation of plate tectonics, erosion, rainshadow, etc. etc. etc. (GitHub - ftomassetti/worldgen).
I am trying to use jMonkeyEngine to visualize the map. I managed to load my HeightMap but I don’t manage to use the right textures for each point. I am using an AlphaMap:
[java]
ByteBuffer textureData = ByteBuffer.allocateDirect(map_widthmap_height3+1);
for (int y=0;y<513;y++){
for (int x=0;x<513;x++){
char r=0,g=0,b=0;
// set either r or g or b at 255.0 depending on some logic
textureData.putChar((y*513+x)3+0,b);
textureData.putChar((y513+x)3+1,g);
textureData.putChar((y513+x)*3+2,r);
}
}
Image textureImage = new Image(Image.Format.RGB8,513,513,textureData);
Texture alpha_texture = new Texture2D();
alpha_texture.setImage(textureImage);
mat_terrain.setTexture(“Alpha”, alpha_texture);
[/java]
If I use my programmatially built alpha texture nothing is shown
Any idea?