Light Paths · an essay you can play with

Every pixel
is a question.

Where did the light that lands here come from? A ray tracer answers by running light backwards, from your eye into the world, bounce after bounce, millions of times. Watch the picture answer itself.

1
samples / pixel
0
light paths traced
0.0s
render time
loading light…
Follow one ray ↓
01

Follow one ray

Below is a room seen from the side. On the left, an eye; in front of it, a film of 48 pixels. For each pixel we fire a ray through it into the room. When it hits something, the surface decides where it goes next: a mirror reflects it, glass bends it, a matte wall scatters it in a random direction. We keep following until it reaches the light, or runs out of bounces and goes dark.

Each finished path is one guess about that pixel's colour. Average enough guesses and the film develops. This is path tracing — the same algorithm rayrender runs in 3D for every image on this page.

↑ THE FILM — what the eye sees, top of the room on the left0 paths

Hover or touch the film column in the room to aim every ray at a single pixel. Try 1 bounce: almost every ray dies before it finds the light, and the film stays black. That is why the next chapter exists.

02

Light needs room to bounce

Now in 3D, rendered by rayrender. Same scene, same everything — except how many times a path may scatter before we give up on it. Drag through it and watch global illumination assemble itself, one bounce at a time.

12345678

03

Noise is just an unfinished average

One path per pixel is a coin toss: some pixels happened to find the light, their neighbours didn't. Each extra sample is another guess. The speckle you see isn't a bug — it's the honest uncertainty of a random estimate, and it shrinks in a very particular way.

1248163264128256
noise ∝ 1 / √N

Quadruple the rays to halve the noise. Hover the image to inspect the grain up close.

04

A material is a rule for the next direction

In a path tracer, "what is this made of?" means only one thing: when a ray arrives, where does it leave? Five rules, five completely different objects — the geometry never changes.

05

A camera is a hole, not a point

A pinhole camera sends every ray from one point, so everything is sharp. Real lenses have width. Start each ray from a random spot on the aperture, aim it at the focal plane, and blur appears for free — wherever the rays disagree.

pinholef/widewiderwidest

Focused on the steel sphere in the middle.

06

Your turn. This one renders live.

Everything above was rendered ahead of time. This image isn't: each change sends your scene to an R process running rayrender on the server, which path-traces it from scratch and streams back increasingly refined passes. You're watching a physically based renderer think.

waiting
—