I have my terrain and i am using this
DirectionalLight sun = new DirectionalLight();
sun.setDirection(new Vector3f(1,0,-1).normalizeLocal());
sun.setColor(ColorRGBA.White);
and this my terrain code
main.getRootNode().detachAllChildren();
Material mapacastelo = new Material(main.getAssetManager(),
"Common/MatDefs/Terrain/Terrain.j3md");
mapacastelo.setTexture("Alpha", main.getAssetManager().loadTexture(
"Textures/mapas/mapacastelo.png"));
Texture grass = main.getAssetManager().loadTexture(
"Textures/aparencia/paredepedras.jpg");
grass.setWrap(Texture.WrapMode.Repeat);
mapacastelo.setTexture("Tex1", grass);
mapacastelo.setFloat("Tex1Scale", 32f);
AbstractHeightMap heightmap = null;
Texture heightMapImage = main.getAssetManager().loadTexture(
"Textures/montanhas/montanhacastelo.png");
heightmap = new ImageBasedHeightMap(heightMapImage.getImage());
heightmap.load();
int patchSize = 65;
terrenocastelo = new TerrainQuad("mapacastelo", patchSize, 513, heightmap.getHeightMap());
terrenocastelo.setShadowMode(ShadowMode.CastAndReceive);
terrenocastelo.setMaterial(mapacastelo);
terrenocastelo.setLocalTranslation(0, 0, 0);
terrenocastelo.setLocalScale(2f, 1f, 2f);
main.getRootNode().attachChild(terrenocastelo);
//CollisionShape sceneShape =
// CollisionShapeFactory.createMeshShape((Node) terrenocastelo);
// RigidBodyControl ft = new RigidBodyControl(sceneShape, 0);
RigidBodyControl ft=new RigidBodyControl(0f);
terrenocastelo.addControl(ft);
main.getPhysicsSpace().add(ft);
I want my terrain use the light of DirectionalLight because my objects already use, but my terrain always is bright and clear, my objetcts have shadow ready and this work good, but my terrain is don’t use DirectionalLight .In my terrain i see the shadow of objects but i don’t see the light in my terrain…