VSM support: Finished!

If you google for VSM, you’ll get a great deal of web-sites describing the technique. What you’re likely going to find a bit more troublesome to find are actual pictures, showing the pros and cons of Variance Shadow Maps.

Therefore, instead of repeating all the content you can easily find elsewhere, let me just put up a few pictures, demonstrating VSM in action:

Scene 1:
Cylinders rotating at different speeds.
Ambient light + a single directional light.

s1-3Plain Shadow Mapping + PCF + normal-based bias adjustment:
Jaggy edges clearly visible.


Variance Shadow Mapping + ~10-tap gaussian blur of the SM:
Shadows definitely softer, but they come at a performance price.
Note the light bleeding problem in the deeper parts of the scene.

s1-2Tweaked VSM + ~10-tap gaussian blur of the SM:
Enforce a minimum value of the pmax and normalize the range, and the problem’s gone. This comes at a price:

  • The shadows have become stronger and their penumbras are not as nice as in the picture right above.
  • The parameter needs to be tweaked for each camera cut.


Scene 2:
Robot 🙂
Ambient light + a directional light.

s2-1Plain Shadow Mapping + PCF + normal-based bias adjustment:
Yeah, well. Meh.

s2-2Variance Shadow Mapping + Gaussian Blur of the SM:
Note the damage the blurring has done to the tiny scene details.

s2-3If we increase the SM size, the details start to come back, but the light bleeding problem intensifies.

Even if you tweak the minimum/maximum allowed variance value, and modify the cut-off, it’s very difficult to find the right balance:
Note taken
: VSMs are not fine for detailed scenes. Layered VSMs may work better in this case.

 Scene 3:
Cube inside a cube.
Ambient light + a directional light + a point light

s3-1Plain Shadow Mapping

s3-2Variance Shadow Mapping (Dual Paraboloid SM) +
2-level Gaussian Blur of the 2-layer SM

The shadows on the cube look nicer and the projection is softened, but the performance cost is huge if you look at the FPS counter of the Plain Shadow Mapping solution. That’s mostly due to the blur which currently is executed separately for each SM layer. With multi-layered rendering, the performance could be likely improved by 40-50%, which would make it much more feasible than as it stands right now.

s3-4Variance Shadow Mapping (Cubical SM) +
2-level Gaussian Blur of the Cube-Map SM

Leave a Reply

Your email address will not be published. Required fields are marked *