DirectionalLightShadowRenderer weirdness


I switched from PSSM to DirectionalLightShadowRenderer. I thought it would be an in-place replace, but I’m experiencing some weird effects:
DirectionalLightShadowRenderer: [video][/video] - the shadows are rendered somehow in the wrong bucket or something and leave a trail while shaking the camera
PSSM: [video][/video]

I’m using the 3.0.3 release.
[java] /* Drop shadows */
final int SHADOWMAP_SIZE = 1024;
DirectionalLightShadowRenderer dlsr = new DirectionalLightShadowRenderer(((Main) app).getAssetManager(), SHADOWMAP_SIZE, 3);
((Main) app).getViewPort().addProcessor(dlsr);[/java]

wow… that’s a weird one. Looks like the shadow rendering is late…actually completely off…
I guess there is a lot more that the code you posted. When, how, do you call this snippet?
Also does the TestDirectionalLightShadows test case does the same?

The test works just fine, that is where I copied the code. I found out what is causing this.
FilterPostProcessor fpp = new FilterPostProcessor(((Main) app).getAssetManager());
SSAOFilter ssaoFilter = new SSAOFilter(12.94f, 43.92f, 0.33f, 0.61f);
((Main) app).getViewPort().addProcessor(fpp);

Before I add the DirectionalLightShadowRenderer, I add SSAO in the same method. Am I not supposed to use them at the same time or…?

Okay, sorry…

In JME3, SSAO is implemented by adding an instance of to a viewport which already simulates shadows using another method such as DirectionalLightShadowRenderer.

So it was the order in which they are added. Now I add SSAO AFTER the DirectionalLightShadowRenderer and everything is fine. Sorry to bother you.

1 Like

Good! no problem.