Computer Graphics
Path Tracing and Monte Carlo
Pixar's RenderMan rendered Toy Story in 1995 with scanline rendering. Coco in 2017 used path tracing with 300-500 samples per pixel - each frame took 200 CPU hours. The difference is Kajiya's rendering equation (1986): a single mathematical formula for all light transport. Path tracing is a numerical solution of that equation. Understanding Monte Carlo integration and importance sampling explains why photorealistic rendering is possible - and why it is so slow.
- **Blender Cycles / Mitsuba 3:** production path tracers in Python/CUDA. Mitsuba is a research platform for new rendering algorithms
- **NVIDIA DLSS 3.5 (Ray Reconstruction):** a neural network trained on path traced data reconstructs a clean image from 1-spp noise - replacing thousands of samples
- **Disney / Pixar / DreamWorks:** every production film uses path tracing with 256-4096 spp for final renders. The total lighting budget for Moana was 200 million CPU-hours
Monte Carlo Integration and the Rendering Equation
In 1986, James Kajiya published the rendering equation - a unified formula for all light transport: Lo(x, wo) = Le(x, wo) + integral[hemisphere] fr(x, wi, wo) * Li(x, wi) * cos(theta) * dwi. Here Lo is outgoing radiance, Le is emission, fr is the BRDF, Li is incoming radiance from direction wi. The hemisphere integral has no closed-form solution for complex scenes. The Monte Carlo method solves this: sampling N random directions wi gives an unbiased estimate of the integral. This is the principle behind Blender Cycles, Arnold, and RenderMan.
Monte Carlo estimate of integral I = integral f(x)dx is approximately (1/N) * sum f(Xi)/p(Xi), where Xi are samples from distribution p. With uniform hemisphere sampling p(wi) = 1/(2*pi), the estimate = (2*pi/N) * sum fr*Li*cos(theta). Error decays as O(1/sqrt(N)) - independent of dimensionality!