A Path Tracer
One bounce at a time, from a single ray to ten million triangles.

The path tracer starts as a question — what does this ray hit? — and ends as a courtyard rendered at ten million triangles, lit by an HDR sky and a hundred small lamps. Each chapter breaks an assumption the previous one was hiding behind.
Geometry comes first: rays, primitives, the bounding volume hierarchy that makes a hundred thousand intersections cheap. Then light, introduced stochastically — a pixel becomes the answer to an integral, solved by Monte Carlo with explicit connections to the sources. Surfaces stop being flat at the scale that matters; the BRDF grows three terms and a sampler that follows the lobe. Light passes through a surface, refracts, and emerges tinted by what it travelled through. The hand-placed sphere light is replaced by a sky and by every emissive triangle in the scene — and the scene itself becomes San Miguel.
The rendering equation does not change across the five chapters. What grows around it is the bookkeeping — acceleration, sampling, materials, transmission, scale — and each addition unlocks an image the previous chapter could not produce.
CHAPTERS
- 01
First Hit
— Ray CastingA 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–TrumboreGLM2026 · FEB · 04→ - 02
Light Finds Its Way
— Path TracingMonte 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 RouletteNext-event estimation2026 · MAR · 01→ - 03
Mirrors
— Microfacet BRDFsThe Cook–Torrance microfacet BRDF — Phong NDF, Smith masking, Schlick Fresnel — and the multiple importance sampling that kills the fireflies it introduces.
Cook-TorrancePhong NDFSmith GSchlick Fresnel2026 · MAR · 14→ - 04
Through Glass
— TransmissionA 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 ReflectionBeer's Law2026 · MAR · 29→ - 05
The Room Itself
— Image-Based Lighting & ScaleScaling 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 geometryBinary scene cache2026 · APR · 14→