Skip to content
ExtendedSource checked

Variance Shadow Maps

Stores depth moments so shadow maps can be filtered with probabilistic bounds.

Quick Facts

Compact metadata for implementation and discovery.

Category
Rendering
Difficulty
Advanced
Family
Shadow Mapping
Tier
Extended
Status
Verified
Review
Source Checked
Sources
1
Formulas
1
Relationships
3
Code example
Ready
Visualization
Ready

Overview

Variance shadow maps estimate the chance a fragment is lit using stored first and second depth moments, allowing smoother filtered shadows.

Core Concepts

depth momentschebyshev boundshadow filteringlight bleeding

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(1)

Average

O(pixels)

Worst

O(pixels)

Space

O(shadow map)

When to Use

  • Use when real-time graphics needs depth moments.
  • Use when the input matches the assumptions behind shadow Mapping.

When Not to Use

  • Avoid when the effect costs more than the visual improvement for the target hardware.
  • Avoid when a simpler algorithm gives the required result with less setup.

What It Does

  • Stores depth moments so shadow maps can be filtered with probabilistic bounds
  • Uses depth moments and chebyshev bound to guide the work.
  • Produces rendered image.

Use Cases

  • Real-time graphics
  • Offline rendering
  • Lighting and visibility effects

Inputs

  • Scene geometry
  • Materials
  • Camera and lighting state

Outputs

  • Rendered image
  • Visibility or shading buffers

Key Formulas (1)

Variance

variance = E[z2] − E[z]2
variance = E[z^2] - E[z]^2

Computes stored depth variance for probabilistic shadow tests.

Pseudocode

  1. 1.Prepare the inputs and state needed for Variance Shadow Maps.
  2. 2.Apply the depth moments step while the stopping condition has not been met.
  3. 3.Update intermediate state and discard invalid candidates.
  4. 4.Return rendered image.

Canonical Example

Input
Variance Shadow Maps input with a small representative case
Output
Rendered image
Explanation
Variance Shadow Maps applies depth moments to produce rendered image.

Implementation Notes

  • Keep the data space for positions, normals, and samples explicit in the implementation.
  • Keep the depth moments step separate enough to test independently.

Common Pitfalls

  • Mixing coordinate spaces or sampling domains leads to artifacts that are hard to debug.
  • Forgetting to check edge cases can make Variance Shadow Maps look correct on only ideal inputs.

Interactive Mechanism Walkthrough

Spatial Primitive & Sweep-Line Canvas

Show rays, samples, buffers, or shading terms that contribute to the final pixel.

Variance Shadow Maps mechanism walkthrough step 1 of 4
Step 1 of 4: Prepare the inputs and state needed for Variance Shadow Maps.
rendering-mechanism

Notes

Variance Shadow Maps should be used with the assumptions and tradeoffs of shadow Mapping in mind.

Sources (1)

What each reference supports for this entry.

Donnelly and Lauritzen 2006

Paper

Original variance shadow maps paper using depth moments for filterable shadows.

Open source

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

Improves onShadow Mapping

Variance shadow maps make shadow filtering easier.

Variant ofShadow Mapping

Variance shadow maps store depth moments instead of one depth value.

Tags

GraphicsShadowFilteringVisibility