I am trying to set the fade length of a directionalLightShadowRenderer. If I understood it right, this should prevent the abrupt appearing of shadows on approaching objects if the zExtent of the Shadow is set and let the shadow appear gradually on approaching. I am setting my shadow as follows, can you see what my mistake is? Did anyone else ever encounter problems using this method / property?
I tried a bit more, and I found, that with my current performance using multiple “nbsplits”, I could simply set the shadow-Distance to the frustum far distance. This kind of solves my problem, but also creates another:
The DirectionalLightShadowRenderer uses “splits” to optimize the performance:
Quote from the Documentation:
It splits the view frustum in several parts and compute a shadow map for each one.
splits are distributed so that the closer they are from the camera, the smaller they are to maximize the resolution used of the shadow map.
Now, the borders between these splits are “hard”, which means when moving through a scene, one can see these borders moving along. Is there a way to interpolate between these splits to have smooth transitions between them?
OK indeed shadowsZExtend does not do the smooth transition anymore. I’m gonna look into it.
As your second question it’s a drawback of the PSSM technique that can’t be worked around. No interpolation is possible between splits.
It’s caused by the big difference in rasterized resolution of the shadow maps because the splits doesn’t cover the same surface.
Reducing the first split distance usually does make the issue less obvious.
I’m gonna try to fix the first issue and the second issue should be less noticeable then.
there is a setLambda parameter. the lower the value the shorter are the splits (except the last one).
This may not be intuitive. It is a lot more obvious when you know about PSSM http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html
Lambda is a logarithmic factor that is used to split the frustum.
the lambda parameter actually did help the problem a bit. So thanks again for the hint. Is there any news / workaround / etc. regarding the shadowZFadeLength functionality?