top of page

Sample Distribution Shadow Mapping

 

In my opinion, one of the most important effect in a video game is shadowing as it can "ruin" your scene if the shadow quality is too low. Many modern games still suffers from pixelated shadows or visual artifacts like shadow acne or peter-panning.

Pixelated shadows in The Last Of Us (Naughty Dog)

There are few rasterizers (in opposition to raytracers) that are able to deliver great shadows in every circumstances. Besides, as always, you have to choose in between quality and performance. There is currently no perfect technique to implement shadow mapping.

 

One of the most used technique is cascaded shadow mapping (known as Parallel-Split Shadow Mapping - PSSM).

It's a good fit between quality and performance but it's far from being perfect at all since it has some drawbacks :

    - It is scene dependant (artists often tweak split values)

    - at least one render pass per cascade.

 

Sample Districution Shadow Mapping (SDSM) is, in a way, the evolution of PSSM. It uses the same principle (Z-partitioning) and it's very easy to implement SDSM once you've done PSSM. SDSM greatly improves shadow quality and is scene independant (the artist no longer tweak partitions values).

Because the frustum for each partition is calculated on the GPU, SDSM could be even better if the GPU was able to submit frustum culling work to itself. As mentioned in the SIGGRAPH paper : "A potential caveat about using the SDSM results for better frustum culling is that the data is generated on the graphics card and thus is not readily available to the CPU for culling.One option is simply to stall and read back the partition results.While this is typically a bad thing to do, it’s what we do for now and it’s less slow than you might imagine.Frustum culling can actually be computed very efficiently on the GPU right now, but there’s currently no good mechanism for the GPU to drive rendering.In the long run we really need better hardware and programming models that allow the GPU to submit work to itself instead of being spoon-fed by the CPU."

 

Once again, I started from the article from Andrew Lauritzen for the same reasons as for tiled deferred. (you can find it here)

SDSM is not a perfect technique since there is an issue when an object is very close but doesn't cast shadows that are seen at screen (see picture below). The Z value is taken into account in the SDSM and the partitions are then non optimal. Although, the quality of the shadows of SDSM are way better than any other technique that I know so far.

The object in red cast a shadow but the shadow itself isn't displayed. ​The partitioning is non-optimal.

Without the object in front, the partitioning is correct.

The shadow quality of SDSM is very high.

Exponential Variance Shadow Mapping allows to blur the edges and to display smooth soft shadows 

bottom of page