Hello! I’ve set a scene with a direct light and a point light.
As you can see only the direct light casts shadows (which also proves that the shadow mode is set correctly). When I try to make point light cast shadow with this code
PointLight lamp = new PointLight();
lamp.setPosition(new Vector3f(0, 8, 0));
lamp.setColor(ColorRGBA.White);
rootNode.addLight(lamp);
PointLightShadowRenderer plsr = new PointLightShadowRenderer(assetManager, 512);
plsr.setLight(lamp);
plsr.setEdgeFilteringMode(EdgeFilteringMode.PCF4);
viewPort.addProcessor(plsr);
nothing really happens. I’ve tried to turn off the direct light and its shadow renderer, and, alternatively, to (un)set flush queues as as described in docs, but to no avail. Point light is set directly above 3 objects.
Not really. I’ve tried to disable (commented out) the DirectionalLightShadowRenderer and the DirectionalLight with no result.
I’ve tried it. Still nothing.
Simply put, I cannot get point light shadow casting to work whith or whitout the other light source / shadow renderer present and with or without setFlushShadowQueues(false) on the first renderer.
I know this is very old. But since i found it a few times, and it wasn’t resolved here (it is in another thread), i thought i would post the fix. Or at least what i believe is the fix.
By default Point Lights have a light radius of zero. This is used by the shadow renderer/Filter and hence you get not shadows. Set the point light to the required radius and everything should work fine.
While we’re here (I just didn’t want to make a thread about this yet) does anyone know of any obvious reason why a directional light shadow renderer would stop working only when I change the directional lights direction?