
First Hit
A CPU ray caster: sphere, box, cylinder, triangle, and the BVH that drops a single frame from 89 seconds to 130 milliseconds.
One bounce at a time, from a single ray to ten million triangles.
The path tracer starts with a question: what does this ray hit? Five chapters of answering it turn a single ray into the San Miguel courtyard 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.
The rendering equation does not change across the five chapters. What grows around it is the bookkeeping: acceleration, sampling, materials, transmission, scale. Each addition unlocks an image the previous chapter could not produce.

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

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

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

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.

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.