@BigBob, I would like to know if you are using jME unshaded terrain?
I have tried it but no luck yet. I did try all those other tips of changing the terrain material at runtime explained here:
Link to Unshaded terrain
This is what my code looks like:
public static void makeTerrainUnshaded(TerrainQuad terrainQuad) {
SceneGraphVisitor sgv = new SceneGraphVisitor() {
public void visit(Spatial spatial) {
if (spatial instanceof Geometry) {
Geometry geom = (Geometry) spatial;
System.out.println("Parse Terrain -> " + geom);
Material mat = new Material(SharedSystem.getInstance().getBaseApplication().getAssetManager(), "Common/MatDefs/Terrain/Terrain.j3md");
mat.setBoolean("useTriPlanarMapping", false);
mat.setTexture("Alpha", geom.getMaterial().getTextureParam("AlphaMap").getTextureValue());
if (geom.getMaterial().getTextureParam("DiffuseMap") != null) {
mat.setTexture("Tex1", geom.getMaterial().getTextureParam("DiffuseMap").getTextureValue());
mat.getTextureParam("Tex1").getTextureValue().setWrap(Texture.WrapMode.Repeat);
mat.setFloat("Tex1Scale", Float.valueOf(geom.getMaterial().getParam("DiffuseMap_0_scale").getValueAsString()));
}
if (geom.getMaterial().getTextureParam("DiffuseMap_1") != null) {
mat.setTexture("Tex2", geom.getMaterial().getTextureParam("DiffuseMap_1").getTextureValue());
mat.getTextureParam("Tex2").getTextureValue().setWrap(Texture.WrapMode.Repeat);
mat.setFloat("Tex2Scale", Float.valueOf(geom.getMaterial().getParam("DiffuseMap_1_scale").getValueAsString()));
}
if (geom.getMaterial().getTextureParam("DiffuseMap_2") != null) {
mat.setTexture("Tex3", geom.getMaterial().getTextureParam("DiffuseMap_2").getTextureValue());
mat.getTextureParam("Tex3").getTextureValue().setWrap(Texture.WrapMode.Repeat);
mat.setFloat("Tex3Scale", Float.valueOf(geom.getMaterial().getParam("DiffuseMap_2_scale").getValueAsString()));
}
geom.setMaterial(mat);
}
}
};
terrainQuad.depthFirstTraversal(sgv);
}
And here is the black scene:
Please help if possible?