Skip to content
ExtendedSource checked

Shadow Volumes

Creates extruded volumes from occluders to identify pixels in shadow.

Quick Facts

Compact metadata for implementation and discovery.

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

Overview

Shadow volumes use stencil operations while rendering extruded silhouette geometry to count whether a view ray enters a shadowed region.

Core Concepts

silhouette edgestencil bufferextruded volumevisibility test

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(geometry)

Average

O(geometry + pixels)

Worst

O(geometry + pixels)

Space

O(stencil buffer)

When to Use

  • Use when real-time graphics needs silhouette edge.
  • Use when the input matches the assumptions behind visibility.

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

  • Creates extruded volumes from occluders to identify pixels in shadow
  • Uses silhouette edge and stencil buffer 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

Pseudocode

  1. 1.Prepare the inputs and state needed for Shadow Volumes.
  2. 2.Apply the silhouette edge 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
Shadow Volumes input with a small representative case
Output
Rendered image
Explanation
Shadow Volumes applies silhouette edge to produce rendered image.

Implementation Notes

  • Keep the data space for positions, normals, and samples explicit in the implementation.
  • Keep the silhouette edge 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 Shadow Volumes 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.

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

Notes

Shadow Volumes should be used with the assumptions and tradeoffs of visibility in mind.

Sources (1)

What each reference supports for this entry.

Crow 1977

Paper

Foundational shadow-volume paper for geometric shadow construction.

Open source

Explore Next

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

Alternative toShadow Mapping

Shadow volumes use geometric volumes rather than depth maps.

Conceptual neighborZ-Buffering

Stencil shadow volumes are often used with depth-tested rendering.

Tags

GraphicsShadowVisibilityGeometry