But in editor it looks just fine.
Here is the code:
Spatial object = assetManager.loadModel(“Models/road1.j3o”);
object.setLocalTranslation(-10, 0, -10);
object.setShadowMode(RenderQueue.ShadowMode.CastAndReceive);
rootNode.attachChild(object);
But some of my models are loaded fine, so I have this problem on some of the models. Can somebody help me please ?
DirectionalLight light = new DirectionalLight();
light.setColor(new ColorRGBA(1, 1, 1, 1));
light.setDirection(new Vector3f(-0.37f, -0.46f, -0.8f).normalize());
rootNode.addLight(light);
final int SHADOWMAP_SIZE = 8192;
DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(assetManager, SHADOWMAP_SIZE, 4);
dlsr.setLight(light);
viewPort.addProcessor(dlsr);
DirectionalLightShadowFilter dlsf = new DirectionalLightShadowFilter(assetManager, SHADOWMAP_SIZE, 4);
dlsf.setLight(light);
dlsf.setEnabled(true);
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
fpp.addFilter(dlsf);
viewPort.addProcessor(fpp);
Here is my lighting setup, if i change light.setColor(new ColorRGBA(1, 1, 1, 1)); to light.setColor(new ColorRGBA(7, 7, 7, 7)); for example, this model looks just fine, but other models are just white.
You shouldn’t use both the DirectionalLightShadowRenderer AND the DirectionalLightShadowFilter. Choose one them.
As stated on the wiki.
You only need one shadow simulation per light source: if you use shadow rendering, you won’t need a shadow filter and vice versa. Which way is more efficient depends partly on the complexity of your scene. All six shadow simulation classes have similar interfaces, so once you know how to use one, you can easily figure out the rest.
Also, what does the material for the road piece look like, I mean the j3m properties.
I am sorry, reply using email didn’t work it seems:
Jep then definately try your AmbientLighting or the Colors of the Material (Ambient, Specular, etc)