Game Development Community

Making T3D's PSSM shadows stop flickering [resource]

by Manoel Neto · in Torque 3D Professional · 10/02/2011 (9:13 am) · 4 replies

This has always bugged the hell out of me, and I finally fixed it! No more shadow pixel crawling for static objects. Resource here:
www.garagegames.com/community/resources/view/21284

The next step is to fix the terrible waste of depth resolution: I just realized all PSSM splits share the same depth range. A lot of depth is wasted in space outside the view frustum as well. I'll have to change it so each split changes the near and far planes so they are tight to the frustum bounding sphere and use a technique called "pancaking" to deal with shadow casters outside the frustum without having to waste precious depth with them.

But this will take a bit more work, since it involves modifying a few shaders as well. The result is that it will fix the "shadows fade out under the player's feet" problem, which is caused by insufficient depth resolution to represent the space between the feet and the ground.

#1
10/02/2011 (9:22 am)
I'm going to have to give this a shot - hope it also works when the Time of Day is running.... lol
#2
10/02/2011 (9:37 am)
Yeah... no. ToD will make the shadows flicker, there's no way around it. This is why there are barely no AAA games with full ToD changes. I

You need vast amounts of filtering to mask the flickering if the sunlight direction is changing all the time. Another trick is to round off the sun's elevation so ToD-based direction changes happen less often. I think Red Dead Redemption does this.
#3
10/03/2011 (5:07 pm)
Does it look better than before? Better is good - but the shimmer is most noticeable with trees and shrubs (or other detailed shadows) so I could hide it with some wind I guess....
#4
10/03/2011 (7:06 pm)
Anything that moves will cause shimmering because they are moving in the shadowmap texture. Static foliage sometimes shimmer at a distance due to the nature of alpha-test.

With stable shadows you can increase the logweight, reduce shadow resolution and use low sun elevations without turning the entire scene into a jittery mess. The shadows cast by terrain and other static structures looks "static" as it should.