Chapter 9. Deferred Shading in S.T.A.L.K.E.R. — Oles Shishkovtsov
- Source: https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-9-deferred-shading-stalker
- Volume: GPU Gems 2
- Note: add-only excerpt; images omitted.
Summary of full chapter read
100% deferred, 100% dynamic lighting for STALKER. Motivation: cut CPU batches from dynamic shadows; avoid repeating expensive material work per light.
Myths
Not inherently slower on DX9 if overdraw moderate. Directional lights still benefit when shadowed (sun stencil skip). Materials via MRT attributes + light shaders indexed by material ID (invert forward's light-modifies-material).
Optimizations
Hierarchical cull lights (sector-portal + CPU occ + occlusion query + stencil). Artistic light flags (shadow? project? translucent casters? specular?). Sun: stencil-mask sky, backfacing, AO=0 → ~2× measured. G-buffer: prefer decode simplicity over bit packing; settled on eye-space pos+AO and normal+material in A16R16G16B16F. Omni shadows as six spotlights for filtering/packing. Virtual position offset along normal by height helps parallax+shadow acne. Vertex AO replaces lightmaps. Material LUT (N·L, N·H, material). Edge-detect AA (depth+normal). Bloom-based exposure. Transparency: forward hack without shadows.