Following light through a scene

Weekend Raytracer is a small CPU renderer built as a hands-on way to understand the fundamentals behind physically based rendering.

The renderer sends rays from a configurable camera into a scene, finds their intersections with geometry, and recursively follows scattered rays to accumulate emitted and reflected light. Multiple samples per pixel reduce noise and produce soft, progressively refined images.

A ray-traced scene demonstrating different sphere materials

What it implements

  • Lambertian diffuse, metallic, dielectric, and emissive materials
  • Solid-color, checkerboard, and image textures
  • Recursive ray scattering and emitted light
  • Anti-aliasing through multi-sample rendering
  • Axis-aligned bounding boxes
  • A bounding volume hierarchy for faster intersection testing
  • A configurable perspective camera

The project is intentionally compact. Its value is in making the rendering equation tangible: every material, ray intersection, and acceleration structure has a visible effect on the final image.