There is something completely effed up about this. I’ve tried this in about 300 billions ways and it’s never giving anything close to what I expect, it’s infuriating.
I did a small splatting test.
4 textures (diffuse maps) = snow, rock, tundra and forest.
1 alpha map.
1 height map.
alphamap and heightmap are same size, 4096 x 4096
The alphamap:
The result (flying VERY high):
I’m trying to find the correlation between the alphamap and the 4 textures and I can’t. Every test I have made is a variant of that. It’s just not making ANY sense to me.
The alphamap is a simple RGB/8 with no alpha channel (no example of those alphamap has an alpha channel), but adding an alpha channel doesn’t change the result.
What I expect:
Each texture in the order given (diffuse 0, 1, 2, 3) would be applied to the RGB in the alphamap. AND, any overlap (which there is none of in this example) would blend the textures depending on the color.
Am I wrong in this assessment? (I have to be)
PLEASE before I do the unthinkable and do something I will regret to the first passerby, enlighten me!
Thanks.
EDIT: Crap I forgot the code. blink
[java]
Texture topAlpha = assetManager.loadTexture(“Textures/Terrain/rgbalphamap.png”);
terMat.setTexture(“AlphaMap”, topAlpha);
terMat.setTexture("DiffuseMap", snow); // snow
terMat.setFloat("DiffuseMap_0_scale", 512);
terMat.setTexture("DiffuseMap_1", rock); // rock
terMat.setFloat("DiffuseMap_1_scale", 256);
terMat.setTexture("DiffuseMap_2", tundra); // tundra
terMat.setFloat("DiffuseMap_2_scale", 512);
terMat.setTexture("DiffuseMap_3", forest); // forest
terMat.setFloat("DiffuseMap_3_scale", 512);
terrain.setMaterial(terMat);
[/java]
EDIT 2:
If there is ANYTHING else than transparency around the Red Green Blue colors (as above) the WHOLE thing is painted with the forest texture. I tried white, black and gray (128, 128, 128). I… I can’t even… brain oozes out by ear canals
Edit 3:
Tagged as fixed.