Learning path

Full curriculum

Full curriculum

Unit content

Ray tracing for visibility, shadows and reflections

Ray tracing renders an image by tracing rays from the camera through image samples into the scene.

For each primary ray, the renderer finds the nearest intersection. That hit determines the visible surface and provides the position, normal and material needed for shading.

Additional rays answer visibility questions. A shadow ray toward a light tests whether another object blocks that light. A reflected ray follows the mirror-reflection direction and can reveal another visible surface.

Recursive ray tracing repeats this process for reflections or refractions until a chosen depth or contribution threshold is reached.

Ray tracing solves visibility differently from rasterization. Rasterization projects primitives toward pixels; ray tracing begins with an image sample and searches the scene for geometry along its viewing ray.

The conceptual algorithm is simple, but naive intersection with every primitive is expensive. Practical renderers therefore organize geometry so most objects can be rejected without testing them individually.