A deep-dive into analytic fog rendering using volumetric primitives with varying density. Covers the Beer-Lambert Law, heterogeneous volumes, and the limitations of ray-marching. Derives closed-form antiderivatives for five radial density functions (linear, quadratic, quartic, spiky, and Gaussian) to compute transmittance along a ray without numerical integration. Includes GLSL-style code snippets for each function and links to a Shadertoy implementation. Also briefly discusses lighting hacks, particle system integration, and boolean CSG operations for fog-of-war effects.

10m read timeFrom matejlou.blog
Post cover image
Table of contents
A Brief Review of Fog RenderingHeterogenous VolumesRadial FunctionsLinear DensityQuadratic DensityQuartic DensitySpiky DensityGaussian DensityExtra Stuff

Sort: