Jump to ratings and reviews
Rate this book

Ray Tracing in One Weekend

Rate this book
This informal book takes you through most of the author's university course on ray tracing. Each mini-chapter adds one feature to the ray tracer, and by the end the reader can produce the image on the book cover. Details of basic ray tracing code architecture and C++ classes are given.

49 pages, Kindle Edition

Published January 26, 2016

122 people are currently reading
222 people want to read

About the author

Peter Shirley

16 books1 follower
Librarian Note: There is more than one author in the Goodreads database with this name. This profile may contain books from multiple authors of this name.

Other authors publishing under this name are:


Peter Shirley, UK wildlife writer and columnist
Peter Shirley, American computer scientist and computer graphics researcher

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
140 (62%)
4 stars
65 (29%)
3 stars
15 (6%)
2 stars
2 (<1%)
1 star
1 (<1%)
Displaying 1 - 21 of 21 reviews
Profile Image for Ivan.
24 reviews3 followers
March 18, 2019
A very nice tutorial! It's light on theory, but allows you to get started in ray tracing pretty quickly and generate beautiful images with your own code, just printing pixels colours to PPM image text files (no OpenGL or other heavy weight libraries). I liked the hand-drawn diagrams and author's terse and "to the point" narration style.

I've coded this project in Rust, check it out :)
https://github.com/sphynx/rt
Profile Image for David Kopec.
Author 14 books21 followers
March 18, 2018
As implied by the title, I was able to complete Ray Tracing in One Weekend in about 10 hours, including translating all of the source from C++ to Swift as I went. There's a reason this book is so popular: It's difficult to explain deep technical subjects like this concisely and Shirley does it well. Technical books on a subject like this tend to either be long-winded affairs in textbook format, or poorly written trade books. This book is neither long-winded nor poorly written. In that sense it's a triumph.

Programming wise, you will need nothing more than the equivalent of two college courses (intro programming, object-oriented programming) to complete this book. I would call the level of programmatic difficulty "intermediate." Math wise, you will need high school level geometry as well as some basic knowledge of vectors including especially dot products & cross products. If you have never seen geometry described using three-dimensional vectors then this book will be impossible. Most of the intended readers likely have seen that math.

So, if it's a well-written book that stays within its titular call-to-action, then what's the problem? Polish—the book lacks polish. This is the kind of problem that gives self-publishing a bad name. The source code snippets are presented in images with text so small that it is hard to read. As of the Kindle version of March 2018, there are multiple mistakes in the source code in said images (unused variables, wrong constants, actual logic errors), some of which Shirley explicitly changed in the Kindle text to point out, yet did not fix in the source code snippet images. His decision to use these convoluted source code images are explained away on his blog for expediency and in the introduction as incentive to type the code in. Yes, we should type the code in ourselves, but not at the expense of it being so small in the book that it's unreadable and hard for him to update to revise the Kindle edition.

There other polish issues too — a lack of comments in the source code, text that could've used a good copy editor, hand drawn diagrams that are not as lucid as they could be. Shirley has written a great book, but he needs to clean it up so as not to continue to give self-publishing a bad name!
Profile Image for Carlos Scheidegger.
74 reviews19 followers
December 24, 2017
(I mean, I took a course from Pete in grad school, so of course I'm biased) I picked this up to have a small project through which to get back into Rust. The book doesn't disappoint.

I'll tell you this - I've never written anything else that comes near this ratio of satisfaction per line of code. Highly, highly recommended.
7 reviews
August 27, 2025
Took me more than a weekend to fully grasp what was going on in this book. The concepts presented are similar to those from a computer graphics course I took in my senior year of university, but this book leans more toward the technical and implementation side. It's an excellent resource for learning basic trigonometry and C++. I personally read it for the C++ aspects.

I have implemented the book's examples and created a GitHub repository for it, adding a Makefile to simplify the build process. You can find the repository here: . I definitely plan to read the other two books in the series and add their implementations to the same repository.
10 reviews3 followers
April 26, 2020
This was a ton of fun! Translating the easy-to-follow code to Haskell and seeing my code produce images that matched those in the book was immensely satisfying (and also pushed me to use Haskell features that I had been confused about before). It took me a bit longer than a weekend though.

The book series is now available for free at https://raytracing.github.io/, and is also open source (I've submitted a couple copy edits).
19 reviews1 follower
December 2, 2018
Great approach to writing a quick path tracer to gives impressive results.

A little bit light on the Fresnel equation details, and the code contains some strange sign choices here and there, but overall, great read and a lot of fun to co-implement as you read.
Profile Image for Joe Davis.
2 reviews1 follower
Read
September 11, 2019
Great into to ray tracing

Concisely introduces the core concepts of ray tracing. The example code is easy to understand and satisfying to compile & run as you go. A short & enjoyable graphics book that I frequently recommended to others.
Profile Image for Dheerendra Rathor.
11 reviews2 followers
December 26, 2017
This book reminded me of Advanced Computer Graphics classes. Reading about ray tracing is boring (it's just normal physics) but implementation is damn fun.
Profile Image for Huy Tran.
9 reviews34 followers
July 16, 2018
Very well written and easy to follow. I don't read all the code but the math and explanation are very interesting. A must read for anyone want to start writing Ray Tracer.
1 review
July 3, 2019
Simple and fantastic resource!

A great learning resource, full of straightforward examples. Provides a great foundation for learning how to build a working raytracer.
2 reviews2 followers
May 22, 2017
I really enjoyed this book. It's a very light reference that presents you with a raytracer that can produce some fairly nice-looking images. I don't think that this is a weekend project as the book makes it out to be. I think one to two weeks is a much more reasonable timeframe to complete the raytracer defined in this book. Some of the equations and code (EG: ray refraction, Shlick's approximation) were quickly glossed over, and required additional work from the reader to understand. At the end of the day, it is a very nice, short implementation-centric book that produces pretty pictures, so I recommend it.
Profile Image for Mariusz Bartosik.
45 reviews1 follower
October 20, 2017
Overall, this mini-book is like a notepad with lecture notes. Short explanations, hand drawn images and code snippets are there, but you have to do additional research and organise exercise labs on your own. If you are willing to do this, then this book is for you and can bring you some fun and satisfaction. You can find more detailed review and example pictures here:
http://mariuszbartosik.com/books/ray-...
Profile Image for Andrew Pankow.
5 reviews1 follower
October 24, 2016
This is a fantastic introduction to producing images with code. This book quickly allows the reader to grasp the simplicity and elegance of the ray-tracing algorithm without a single external piece of code or library. I would highly recommend this book to anyone who wants to become a better texturing/shading artist as well as for those looking to write their own software.
Displaying 1 - 21 of 21 reviews

Can't find what you're looking for?

Get help and learn more about the design.