I switched from PSSM to DirectionalLightShadowRenderer. I thought it would be an in-place replace, but I’m experiencing some weird effects:
DirectionalLightShadowRenderer: [video]http://youtu.be/2-fCj8-Ws0s[/video] - the shadows are rendered somehow in the wrong bucket or something and leave a trail while shaking the camera
PSSM: [video]http://youtu.be/ClUEejajZJY[/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);
dlsr.setLight(sky.getSunLight());
dlsr.setLambda(0.55f);
dlsr.setShadowIntensity(0.6f);
dlsr.setEdgeFilteringMode(EdgeFilteringMode.Bilinear);
((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.
[java]
FilterPostProcessor fpp = new FilterPostProcessor(((Main) app).getAssetManager());
SSAOFilter ssaoFilter = new SSAOFilter(12.94f, 43.92f, 0.33f, 0.61f);
fpp.addFilter(ssaoFilter);
((Main) app).getViewPort().addProcessor(fpp);
[/java]
Before I add the DirectionalLightShadowRenderer, I add SSAO in the same method. Am I not supposed to use them at the same time or…?
In JME3, SSAO is implemented by adding an instance of com.jme3.post.SSAOFilter 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.