A Path Tracer

A CPU path tracer, from a single ray to San Miguel at ten million triangles.

SAN MIGUEL  ┇  ~10M TRIANGLES  ┇  CPU PATH TRACED  ┇  DENOISEDSource

The first chapter answers one question: what does this ray hit? Five chapters later the same code renders the San Miguel courtyard at ten million triangles, lit by an HDR sky and a hundred small lamps. Each chapter removes an assumption the one before it relied on: that scenes are small, that light arrives directly, that surfaces are perfectly smooth, that nothing transmits.

The rendering equation is the same in chapter five as in chapter one. What changes is the bookkeeping around it: acceleration, sampling, materials, transmission, scale. Chapter one's ray caster would still be running on San Miguel; each addition is what made the next scene tractable.

CHAPTER 01 / 05 · Ray Casting

First Hit

A CPU ray caster: sphere, box, cylinder, triangle, and the BVH that drops a single frame from 89 seconds to 130 milliseconds.

Ray–primitive intersectionBVHMöller–Trumbore
2026 · FEB · 04Read the chapter
CHAPTER 02 / 05 · Path Tracing

Light Finds Its Way

Monte Carlo path tracing: cosine-weighted BRDF sampling, Russian roulette, and the shadow rays that reach a clean image in a tenth the passes.

Monte Carlo integrationCosine-weighted samplingRussian Roulette
2026 · MAR · 01Read the chapter
CHAPTER 03 / 05 · Microfacet BRDFs

Mirrors

The Cook–Torrance microfacet BRDF (Phong NDF, Smith masking, Schlick Fresnel), and the multiple importance sampling that kills the fireflies it introduces.

Cook-TorrancePhong NDFSmith G
2026 · MAR · 14Read the chapter
CHAPTER 04 / 05 · Transmission

Through Glass

A transmission lobe added to the BRDF: Snell refraction at every microfacet, total internal reflection, Beer's-law tint, and the power-heuristic MIS that quiets the sharper lobe.

Snell refractionMicrofacet BTDFTotal Internal Reflection
2026 · MAR · 29Read the chapter
CHAPTER 05 / 05 · Image-Based Lighting & Scale

The Room Itself

Scaling to San Miguel and the Bistro: importance-sampled HDR environment lighting, an area light aggregated from every emissive triangle, a binary scene cache, and offline denoising.

HDR Environment MapImportance-sampled CDFArea Light from emissive geometry
2026 · APR · 14Read the chapter