# Chapter 17. Efficient Soft-Edged Shadows Using Pixel Shader Branching — Yury Uralsky

- Source: https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-17-efficient-soft-edged-shadows-using
- Volume: GPU Gems 2
- Note: add-only excerpt; images omitted.

## Summary of full chapter read
Single-map soft shadows via PCF with stratified jittered disk samples + fragment dynamic branching (GeForce 6). Not physically correct area-light soft shadows, but convincing penumbrae.

### Pipeline
Blur comparison results (not depth). Fixed-offset PCF → banding; jittered/stratified samples → high-freq noise human vision filters. Square strata → area-preserving disk warp. 3D jitter map: screen-tiled (s,t) unique sequences along r; pack 2 offsets/texel (RGBA).

### Adaptive branching
Most pixels fully lit or fully shadowed—one sample enough. Estimator: few jittered samples on outer ring of disk; if all 0 or all 1 (and N·L>0), skip rest. Branch coherence critical for parallel GPUs. Back-face shadow maps + (N·L≤0) kill acne-induced false penumbra. HW bilinear PCF free. >2× FPS vs fixed 64 samples on 6800 GT. Caveat: unusual projections (PSM) need per-pixel penumbra size.

