Ray Tracing in One Weekend
Introduction
Ray Tracing in One Weekend is a series of ray tracing tutorials written by Peter Shirley, spanning three books. Using a few hundred lines of C++ code, the tutorials guide you through building a complete ray tracer from scratch — achievable in just three days.
This series is the best hands-on project for getting started with graphics. You'll implement: ray generation, object intersection, reflection, refraction, shadows, scattering, camera systems, and acceleration structures. At the end, you'll have a beautifully rendered image produced by your own code — an incredible sense of accomplishment.
The three books progress as follows: - Book 1: Basic ray tracing, building a simple renderer - Book 2: Adding textures, volume rendering, instancing, and BVH acceleration structures - Book 3: Building a complete path tracer supporting global illumination
Prerequisites
- C++ basics: Familiarity with basic syntax is sufficient; no advanced features needed
- Basic math: Vector operations (addition, subtraction, dot product, cross product) — the tutorial explains these in detail
- No graphics background required: This tutorial IS your graphics introduction
Difficulty
🌟🌟 (Beginner)
The tutorial starts from scratch with detailed mathematical derivations and clean code — the best starting point for learning graphics.
Estimated Study Hours
Approximately 20-30 hours (three books, ~7-10 hours each)
- Book 1: ~7-10 hours
- Book 2: ~7-10 hours
- Book 3: ~7-10 hours
Resources
- Book 1: Ray Tracing in One Weekend
- Book 2: Ray Tracing: The Next Week
- Book 3: Ray Tracing: The Rest of Your Life
- Source code: GitHub
Self-Study Tips
-
Type the code yourself. Don't copy-paste. Type every line and understand what each one does. When you hit errors, try debugging them yourself.
-
Don't rush. Despite the name "One Weekend," there's no need to finish in a single day. Each chapter is packed with knowledge — digesting slowly is more valuable than speed-running.
-
Modify parameters and observe changes. Try changing material parameters, light positions, and camera angles. Observing how the rendered output changes is the best way to understand graphics principles.
-
Draw diagrams to aid understanding. The processes of ray reflection, refraction, and scattering are much easier to understand with diagrams than with text alone.
-
Try extending after finishing. After completing all three books, try adding your own features: depth of field, motion blur, ambient occlusion. This is the key step from "following along" to "creating on your own."