The recursion, one path at a time

Path recursion & termination

The rendering equation is defined in terms of itself, so evaluating it means following a path from bounce to bounce. Each bounce multiplies the path's throughput by the surface's albedo, so a path fades as it goes — and eventually contributes so little that continuing is a waste. Watch one path at a time and see where it stops mattering.

One path through the scene
Click to aim the camera ray
the path, fading with throughput shadow ray that reached the light shadow ray that was blocked
Throughput, bounce by bounce
Controls the path
6
0.68
0.020
Bounces taken
Final throughput
Radiance gathered
Why it stopped
Why paths have to end termination

Light in a closed room bounces forever, so the recursion has no natural base case. Something has to stop it, and the choice of what matters more than it looks.

A fixed depth limit is simple and wrong: it throws away all the light that would have arrived after bounce N, so the image comes out systematically too dark. The error is small when albedos are low and grows badly when they are high — push the albedo slider to 0.95 and watch how much throughput survives to bounce six.

A cutoff threshold is the same problem in a different suit: it discards dim paths, which are exactly the ones carrying the last few percent of the energy. It biases the result downwards too, just less obviously.

Russian roulette fixes it. Instead of killing a dim path outright, kill it with probability 1 − p and, when it survives, divide its throughput by p. Fewer paths continue, but the survivors are scaled up to carry the load of the ones that died — so the average is exactly right. It trades bias for variance, and variance is the one that goes away when you take more samples.

Where the light comes from contribution per bounce

Why the first bounce dominates. Watch the chart: bounce 1 usually contributes most of the light, bounce 2 a fraction of that, and by bounce 5 there is almost nothing left. That is the albedo compounding — three bounces off surfaces reflecting 70% each leaves 34% of the energy. It is also why a renderer can often get away with two or three bounces and a cheap approximation for the rest, and why an all-white room is so much more expensive to render than a dark one: at 90% albedo, light takes far longer to die.