Ray Tracing in One Weekend
v4.0.1Peter Shirley's beloved educational book series that guides readers through building a ray tracer from scratch in C++
Development Activity
Commit activity data is not available for this renderer.
Sample Renders
Overview
Best for
Absolute beginners learning ray tracing fundamentals, CS students in introductory graphics courses, and self-taught programmers wanting a hands-on weekend project that builds real understanding
Not ideal for
Production rendering, research requiring advanced features, benchmarking, or any use case requiring performance, scalability, or diverse scene formats
Strengths
- Arguably the most successful educational resource in computer graphics — has introduced hundreds of thousands of programmers to ray tracing through clear, incremental, hands-on implementation
- Zero-dependency approach means anyone with a C++ compiler can follow along with no package managers, build systems, or external libraries, lowering the barrier to entry to near-zero
- Three-book progression takes readers from basic ray-sphere intersection to Monte Carlo importance sampling, covering both practical implementation and mathematical foundations
- CC0 (public domain) license means the code can be freely used, modified, and incorporated into any project without any restrictions — commercial, academic, or personal
- Actively maintained with periodic updates adding corrections, improved explanations, and modern C++ practices
Limitations
- Not a production renderer — the resulting code is intentionally simple and pedagogical, lacking optimizations like SIMD, GPU acceleration, and denoising that production renderers require
- Single-threaded, CPU-only design means rendering any non-trivial scene takes minutes to hours — performance is deliberately not a goal
- No scene description format — scenes must be authored directly in C++ code, which limits practical use beyond learning exercises
- Outputs only PPM images, requiring conversion for modern use, though this simplicity is deliberate to avoid I/O library dependencies
- Limited material system compared to full renderers — covers Lambertian, metal, and dielectric but not the full range of BSDF models used in research or production
Background
Ray Tracing in One Weekend is a three-book series by Peter Shirley (later co-authored with Trevor David Black and Steve Hollasch) that has become the most widely used introductory resource for learning ray tracing. Originally self-published as PDFs around 2013, the series is now freely available online and covers building a complete path tracer incrementally: Book 1 introduces ray-sphere intersection, antialiasing, diffuse materials, metals, dielectrics, and defocus blur; Book 2 adds motion blur, BVH acceleration, textures, lights, and volumes; Book 3 covers Monte Carlo methods, importance sampling, and PDFs.
The code is intentionally minimal — no external dependencies beyond a C++ compiler — and builds from zero to a functional path tracer that produces correct global illumination. Scenes are constructed directly in C++ code, and output is in PPM format. The design choices prioritize pedagogical clarity: the code is single-threaded and CPU-only, with no acceleration structures until Book 2. This deliberate simplicity means the reader can trace every line of code and understand exactly what the renderer is doing.
The series has had an extraordinary impact on the computer graphics community. Countless professional graphics engineers cite these books as their entry point into rendering, and they are assigned reading in university computer graphics courses worldwide. The CC0 (public domain) license means the code can be freely used, modified, and incorporated into any project. Peter Shirley, an NVIDIA Distinguished Scientist and co-author of the Fundamentals of Computer Graphics textbook, continues to maintain and update the series with corrections and modern C++ practices.
Quick Start
git clone https://github.com/RayTracing/raytracing.github.io && cd raytracing.github.io && cmake -B build && cmake --build buildRelated Renderers
Community & Resources
Paper & Citations
Notable Publications
Tutorials & Resources
Performance Benchmarks
No benchmark data available for Ray Tracing in One Weekend yet.
Benchmarks will be added as more renderers are tested across our standard scene suite.
Learn about our methodology