Chapter 10. Real-Time Computation of Dynamic Irradiance Environment Maps — Gary King
- Source: https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-10-real-time-computation-dynamic
- Volume: GPU Gems 2
- Note: add-only excerpt; images omitted.
Summary of full chapter read
GPU (PS3.0 + float textures) generates diffuse/specular irradiance environment maps in real time via spherical-harmonic convolution—dynamic lights/objects can drive radiosity-like fills.
Why
Env map ≈ many directional lights; brute diffuse convolution O(MN) (~151M ops for 32←64 cube). Diffuse irradiance varies slowly; frequency domain cuts cost.
SH pipeline
Project env → SH coeffs (l=2 → 9 coeffs enough for diffuse; specular ~√s). Convolve by multiplying with precomputed BRDF SH (Lambert/Phong). Inverse SH → output irradiance cube/dual-paraboloid. Convolution theorem: spatial convolute = frequency multiply.
GPU mapping
Two passes: (1) spatial→frequency: precompute Y_lm·dω weight tiles; PS3.0 VPOS maps output pixel to tile; loop samples × weight. Dual-paraboloid input → one weight LUT per hemisphere. (2) convolve+evaluate: tile A_lm Y_lm weights per cube face; K-loop over coeffs. Demo >300 FPS irradiance regen on 6800 GT. Shadowing hard—pair with ambient occlusion (Ch14). SH also supports linear interp/add of lighting environments.