Omnidirectional Variance Shadow Mapping




Variance Shadow Maps (VSM) [1, 2] is a new arbitrarily filterable soft-shadowing
algorithm for real-time 3D graphics applications,
first introduced by William Donnelly and
Andrew Lauritzen at ACM Symposium on Interactive
3D Graphics and Games (I3D) 2006.
By definition, the main idea of the VSM is
to use the variance of depths for approximating
the intensity of penumbra. In order to perform
the VSM, we first store the mean and mean
squared of a distribution of depths into
a shadow map and apply a blur filtering to
it as a separate pass, then calculate the
variance over a filter region of the shadow
map and finally, solve the one-tailed version
of Chebyshev's inequality for computing the
intensity (for t > μ):

Here x is a random variable drawn from a distribution
with mean μ and variance σ2, and t is the fragment's depth. Since the quantity
P(x ≥ t) represents the fraction of fragments over
a filter region of a shadow map that will
fail the depth comparison with the depth
t, the result that we obtain from the VSM
is conceptually equivalent to that of Bilinear
Percentage-Closer Filtering (PCF).
In this technical demo, the Flexion Engine
demonstrates Omnidirectional Variance Shadow Mapping (OVSM), the VSM for omnidirectional light sources
(i.e. point lights) using cube maps.
Downloads

- Version 0.94 (April 29, 2006) - flx_ovsm.zip (executable, 4.56 MB)
Note: Since current ATI VPUs do not support
Bilinear Filtering on 16-bit floating-point
texture formats, they cannot produce maximum
quality using the VSM in this demo.
Controls
- F1 - Show information
- F2 - Cycle soft-shadowing mode
- F3 - Toggle light movement
- W/S - Move forward/backward
- A/D - Strafe left/right
- Space/Ctrl - Move upward/downward
Known Issues
- Light bleeding - Since the Chebyshev's inequality is only an upper bound, when σ2 is large, we can see some cases where penumbrae are overlapped with another shadows. This is called "light bleeding" and it often happens if scene geometry has a high depth complexity. Unfortunately, there is no silver bullet for this issue at this point.
- Numerical instability - Since the equation for computing the variance; σ2 = E(x2) - E(x)2 is numerically unstable, some artifacts can be visible when using a 16-bit floating-point texture format like GL_GRBA16F_ARB (4xFP16). This can be avoided by setting a proper variance bias and light attenuation range, but it rarely happens with FP32 texture formats.
- Shadow pull-away - When using back-facing depths for a shadow map as well as the conventional shadow mapping, the shadow pull-away can occur, which is where a shadow starts a number of pixels behind the occluder. Using front-facing depths and setting a very tiny variance bias will solve this issue.
Bibliography
[1] William Donnelly and Andrew Lauritzen,
"Variance Shadow Maps," In Proceedings of the ACM Symposium
on Interactive 3D Graphics and Games 2006,
available online here.
[2] Andrew Lauritzen, "Variance Shadow Maps," Presentation at the 60-Minute Sponsored
Session of NVIDIA Corp., Game Developers
Conference 2006, available online here.
