Introduction
The Ray Tracer Challenge
This course follows The Ray Tracer Challenge by Jamis Buck — a test-driven guide to building a photorealistic 3D renderer from scratch using C++ and mathematics.
A ray tracer works by casting rays from a virtual camera into a scene, computing intersections with objects, and calculating how light bounces to determine each pixel's color. The result is photorealistic rendering: shadows, reflections, refraction, and more.
What You Will Build
Every lesson adds one piece of the renderer:
- Vectors & Points — the fundamental 4-component tuple used for all positions and directions in 3D space.
- Colors — represent RGB color and compute lighting effects.
- Matrices — 4×4 matrices are the engine of all 3D transformations.
- Transformations — translation, scaling, and rotation let you position objects and cameras.
- Rays & Spheres — cast rays into the scene and solve for intersections with spheres.
- Phong Lighting — the classic ambient + diffuse + specular lighting model that makes 3D objects look real.
Why Build a Ray Tracer?
Ray tracers are one of the best projects in computer graphics because:
- The math is pure and beautiful — linear algebra, geometry, and physics combine elegantly.
- The output is immediately visual — your code produces images.
- It exercises everything — classes, functions, floating-point math, recursion.
- The algorithm is timeless — every rendering engine, from Pixar's to NVIDIA's RTX, builds on these ideas.
Let's cast the first ray.