Real-Time Light

A deferred OpenGL renderer, and the approximations that hold it at 60 frames per second.

DEFERRED PBR + IBL + MSM + SSAO + SSDO  ┇  60 FPSSource

The path tracer gets there by brute force: shoot enough rays, average enough samples, and the estimate converges. At sixty frames per second that budget is gone. Every chapter here replaces an integral the path tracer evaluated directly with something cheaper that still holds up under a moving camera.

Each approximation has a place where it visibly fails: variance shadow maps bleed light through layered occluders, moment shadow maps drop thin contact shadows, and screen-space occlusion can only use what is already in the depth buffer. Each of those is named in the chapter that introduces it.

CHAPTER 01 / 05 · Deferred Shading

The G-Buffer

Deferred shading: geometry and material baked into a four-target G-buffer so one Cook–Torrance BRDF evaluation runs per visible pixel, additive per light no matter how many.

G-BufferCook-Torrance BRDFMulti-light PBR
2026 · FEB · 09Read the chapter
CHAPTER 02 / 05 · Shadow Mapping

From the Light's Point of View

Shadow mapping by rendering depth from the light's view, then four progressively softer ways to read it back: biased binary, PCF, variance, and moment shadow maps, blurred in compute.

Shadow MappingPCFVariance Shadow Maps
2026 · MAR · 01Read the chapter
CHAPTER 03 / 05 · PBS + IBL

Light, Pre-Filtered

Image-based lighting in real time: the HDR sky pre-filtered to nine spherical-harmonic coefficients for diffuse, importance-sampled with GGX and Hammersley for specular, then tone-mapped back to display range.

Spherical HarmonicsGGX Importance SamplingHammersley Sequence
2026 · MAR · 28Read the chapter
CHAPTER 04 / 05 · Screen-Space Ambient Occlusion

Where Corners Stay Dark

Alchemy screen-space ambient occlusion: spiral-sampling each pixel's G-buffer neighborhood for the obscurance IBL flattens out, then a depth- and normal-aware bilateral blur before it multiplies the ambient term.

Alchemy SSAOBilateral FilterSpiral Sampling
2026 · APR · 04Read the chapter
CHAPTER 05 / 05 · Screen-Space Directional Occlusion

Light Bounces Once

Screen-space directional occlusion: sampling the 3D hemisphere so occlusion keeps its direction and color, then re-using the blocked samples as secondary emitters for one bounce of indirect light.

SSDOOne-Bounce GIHemisphere Sampling
2026 · APR · 18Read the chapter