Ray tracing

Level AdvancedDifficulty ★★★★★Application⌖ Open in the map

What is it?

Follow rays of light from the camera into the scene: solve for intersections (roots of equations), reflect and refract using the normal, and recurse. Real-time ray tracing is now in consumer GPUs.

Formulas

∥o+t d−c∥2=R2  ⟹  t2+2t d⋅(o−c)+∥o−c∥2−R2=0(∥d∥=1)\norm{o + t\,d - c}^2 = R^2 \implies t^2 + 2t\,d\cdot(o - c) + \norm{o - c}^2 - R^2 = 0 \quad (\norm d = 1)
ray–sphere intersection: a quadratic
r=d−2(d⋅n) nr = d - 2(d\cdot n)\,n
reflection

The mathematics behind it

  • Bisection method★★★★★frequent

    Intersecting rays with implicit surfaces or height fields often brackets the hit and bisects.

Where is it used?

Computing topics reachable from here, through the chain of ideas that leads to them:

What depends on it

This page has the essentials. A fuller treatment (intuition, formal definition, worked example) is on the way.

↑ ↓ to navigate · ↵ · Esc