Optimizing the light far plane while PSSMing
I recently had a cool idea about Parallel Split Shadow Mapping and the light projection on the different frustum splits. By default, every frustum split is handled separately as uniform shadowing or with a special projection algorithm as PSM or LiSPSM. This ensures that every split frustum is enclosed as much as possible to maximize the texel ratio of the shadow/depth map on that volume. But since we have several splits - I use four splits encoded in a ARGB 32bit floating point texture - we also have different light far planes used for the orthogonal projection on that split.
I have done a small and nasty sketch to visualize this issue and since my sketching skills are lim => 0.. eh.. you’ll get the point:
Keeping that construct (?) thing in mind you may notice that the depth representation of the different splits differ, since they are “normalized” to fit in the far plane ratio while using a linearized depth representation. However, this effect will also occur while using the default logarithmic depth representation. To point this construct (?) gizmo out, see attached:
While visualizing this by simply outputting the projected shadow map, that is, the depth vaues, on a 3D scene, it becomes more clearly:
Indiana Jones told me some time ago, that a cross never marks an important spot, but a red mark does
So what we actually want is having the depth representation constant over the whole view frustum and thus all splits. My idea was to use the far plane of the last frustum splits light for all the other light far planes before. You can simply do this by computing/rendering the frustum splits in a reversed order and thus saving the far plane computation on n-1 splits. Cool, eh?
But why do I do this? It’s because of blurring the depth map in some way. Most common blur algorithmns like the good ol’ Gaussian one has, in combination with a modern GPU, the property to work on all components of a non-skalar type at the same time. But this causes the blurred shadow map to suck, because it applies the same filter kernel to all splits at the same time, resulting in larger blurred shadow maps in the distance. It’s a good idea to scale the filter kernel by the distance for each split, but having the depth representation different between the splits comes to a problem too. So basically, we want a depth representation like this:
Having the depth representation across the splits as nice as this, you don’t even notice the split borders anymore if you simply project the shadow map onto the scene (and if you would scale your blur filters kernel size, like I don’t at the moment):
And here is the respective shadow/depth map for that picture above:
Note that the alpha channel is not visible… for some reason you may guess.
Hope this helps






Trackback
RSS Feed

1 comment
1.
Zaknafein wrote at Wednesday, August 12, 2009 / 22:32
Nice stuff! Glad to see you’re still improving on this.