How to set AmbientColor of terrain

Type here. Use Markdown, BBCode, or HTML to format. Drag or paste an image to upload it.

I have directiinal light, a terrain wuth Heightmap and its material (TerrainLighting.j3md). Now I want to make terrain material brighter, I set color “Ambient” to blue and I can’t see the result, then I wrote “UseMaterialColors” = true as for other materials, but it says that variable UseMaterialColors is not declared in TerrainLighting.j3md

?

Material color and ambiant lighting are two different things. You have to add you ambiant light as you added your directionnal one. Don’t forget that the lights will only enlight geometries attached to the same node as them (or descendants nodes)

AmbientLight al = new AmbientLight();
al.setColor(...);
rootNode.addLight(al);