Which end of the path to start from

Forward vs reverse ray tracing

Both panels below simulate the same room with the same physics. The only difference is where the ray starts. On the left it leaves the lamp, as light really does. On the right it leaves the camera, backwards. Watch the counters: one of these approaches throws almost all of its work away.

Forward — rays leave the light
reached the camera — useful never reached it — wasted
The image so far0% covered
work thrown away
Reverse — rays leave the camera
camera ray — always useful shadow ray to the light
The image so far0% covered
work thrown awaynone
Forward rays cast
0
Forward rays that landed
0
Reverse rays cast
0
Reverse rays that landed
0
Controls both panels
24
0.45
3

Shrink the aperture towards a pinhole and forward tracing collapses — the probability that a randomly aimed ray finds the lens falls with its area. A real camera aperture is a few millimetres across in a room metres wide, so the true hit rate is far worse than anything shown here.

What the counters are telling you live

Forward tracing is not wrong — it is how light actually behaves, and it is the only way to get some effects, such as caustics, without heroic effort. It is simply an appalling way to spend a compute budget when you already know which rays you care about: the ones that end up at the camera.

Reverse tracing inverts the problem. Start at the camera and every path is useful by construction. This works because BRDFs are reciprocal — the fraction of light going from ωi to ωo is the same as from ωo to ωi — so a path traced backwards carries the same value as the same path traced forwards.

The one thing reverse tracing still cannot know. Starting from the camera guarantees a path reaches the film, but not that it reaches a light. A path that bounces around and ends in darkness contributes nothing, which is why the shadow ray exists: at every bounce, reverse tracing stops guessing and connects directly to a light source it already knows the position of. That single trick — sampling the light instead of hoping to hit it — is what makes the method practical, and it is the step the notes call direct illumination.