Hello, please save me
I´m importing 3D model from Blender (file .blend) to jME SDK. In import dialog and in SceeneComposer I see model corect
But in game I see it bad .
I´m new in JME… I think there is something wrong with lights, but I don´t know what…
I add this lights to the game:
AmbientLight ambient = new AmbientLight();
ambient.setColor(ColorRGBA.White);
rootNode.addLight(ambient);
DirectionalLight sun = new DirectionalLight();
sunPos = new Vector3f(0.0f, -0.05f, 0.0f);
sun.setDirection(sunPos);
sun.setColor(ColorRGBA.White);
rootNode.addLight(sun);
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
Vector3f lightPos = sunPos.multLocal(-3000);
DirectionalLightShadowFilter dlsf = new DirectionalLightShadowFilter(assetManager, 1024, 2);
dlsf.setLight(sun);
fpp.addFilter(dlsf);
viewPort.addProcessor(fpp);
I guess you’re looking at the back side of the model from the light direction.
What if you turn around it?
There must be something wrong with the ambient color of your building material.
If your building material has UseMaterialColors to true, make sure the diffuse and ambient color are not black.
Also in order to properly cast Shadows, you have to set a ShadowMode on each geometry (Cast, CastAndReceive, Receive). I recommend to set the terrina to receive only, and the rest to cast and receive.