Hello,
I have another strange issue in 3.1. It looks like this is caused by my own code though as it doesn’t appear in a test case I wrote. Maybe you can still help me as it worked in 3.0. First of all here is a video showing the problem:
I didn’t have that issue with 3.0. The shadows start to “flicker” once I add a particle emitter to the scene (it flickers only once but the beam in the video is actually multiple particle emitters so it flickers the whole time). Now the strange thing: Once I remove the skybox, the issue is gone. I have no idea how the skybox could affect this honestly. The issue appears with the DirectionalLightShadowRenderer as well as with the filter.
Here are the relevant parts of the code:
private void initLightAndShadow() {
DirectionalLight sun = new DirectionalLight();
sun.setDirection((new Vector3f(0.5f, -0.5f, .3f)).normalizeLocal());
sun.setColor(ColorRGBA.White.mult(1f)); //1.3
rootNode.addLight(sun);
AmbientLight ambient = new AmbientLight();
ambient.setColor(ColorRGBA.White.mult(.8f));
rootNode.addLight(ambient);
DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(assetManager, 2560, 3);
dlsr.setEdgeFilteringMode(EdgeFilteringMode.PCF8);
dlsr.setShadowIntensity(.6f);
dlsr.setLight(sun);
viewPort.addProcessor(dlsr);
}
private void initSky() {
Texture west = assetManager.loadTexture("Textures/sky/desertsky_lf.tga");
Texture east = assetManager.loadTexture("Textures/sky/desertsky_rt.tga");
Texture north = assetManager.loadTexture("Textures/sky/desertsky_ft.tga");
Texture south = assetManager.loadTexture("Textures/sky/desertsky_bk.tga");
Texture up = assetManager.loadTexture("Textures/sky/desertsky_up.tga");
Texture down = assetManager.loadTexture("Textures/sky/desertsky_dn.tga");
Spatial sky = SkyFactory.createSky(assetManager, west, east, south, north, up, down);
rootNode.attachChild(sky);
}
When the mouse button is clicked, I just attach a particle emitter and the shadows flicker one time.
As I said, I couldn’t replicate the issue in a testcase I created but I’m really running out of ideas. Were any changes made to the skyboxes or so? I still don’t get why the skybox affects the shadows in such a way (but only in my game, not in the test case??)
Not quite sure if this is a problem in my code or something in 3.1 (it worked in 3.0). I am thankful for any hint.