Chapter 16. Accurate Atmospheric Scattering — Sean O'Neil
- Source: https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering
- Volume: GPU Gems 2
- Note: add-only excerpt; images omitted.
Summary of full chapter read
Full Nishita et al. 1993 atmospheric scattering on GPU (SM2), density exponential with altitude—not Hoffman/Preetham constant-density near-ground approx. Camera may be on ground, in atmosphere, or in space (flight/space sims).
Physics
Ray A→B through atmosphere; sample points P do sun→P out-scatter then P→camera in-scatter. Rayleigh (molecules, λ⁻⁴, blue sky / red sunset) vs Mie (aerosols, gray haze, sun halo; Henyey–Greenstein phase with g≈−0.75..−0.999). Optical depth ≈ ∫exp(−h/H₀); H₀≈0.25 of atmosphere thickness.
Making it real-time
Naive nested integrals ~300–3000 ops/vertex. Graphically analyze optical-depth LUT: height axis ≈ exp(−4x); remaining angular “scale function” fit by polynomial for fixed thickness/radius ratio (demo: thickness 2.5% of planet radius, scale height 25% of thickness). Separate VS for Sky/Ground/Space × FromSpace/FromAtmosphere; phase in FS to avoid tessellation artifacts. Often drop Rayleigh phase (too dark at 90°) as proxy for missing multiple scatter. Needs HDR: color = 1−exp(−exposure×hdr).