Book Review: The Ray Tracer Challenge Wednesday 14th of August 2019

Book cover. And yes, by the time you've finished the book you can render the scene printed on it
Book cover. And yes, by the time you've finished the book you can render the scene printed on it

This book is a review of The Ray Tracer Challenge by Jamis Buck. It's actually a technical book and so something I wouldn't have expected to post on this particular blog, but I found it such fun writing my ray tracer over the last 6 weeks or so that I'm going to sing its praises from here too.

I bought this book on the 31st May and it sat on my desk for a few weeks whilst wrapping up other work. On the 2nd July I made my first commit and I've spent almost all my free time up until the start of August working through it. I originally intended to blog a sort of mini-series as I progressed, but that went out of the window after the first commit - I was utterly enthralled by the challenge and didn't stop for such mundane tasks as writing blog posts! Even tearing away enough free time to write the original version of review has been challenging, although I mostly wrote it whilst waiting for scenes to render and animations build.

A low quality animation. Higher quality ones were a bit too large for a GIF really!
A low quality animation. Higher quality ones were a bit too large for a GIF really!

I am very glad I bought this book - I have never read anything quite like it. The way it was presented means I was never truly floundering, and it quietly taught me without me realising. I've always had trouble reading linear algebra but I've noticed that I'm now finding it easier to read some formulae. I've still got a way to go with that sort of stuff, but I'm definitely improving.

I did have some problems - several times I didn't notice that the result of a square root was supposed to be negated and wondering why my tests were failing. On occasion I simply didn't read instructions properly and implemented something almost, but not quite, right. And of course, I spent a lot of time trying to make SpecFlow fit how I have traditionally tested. But it was pretty much all user error... I didn't spot any mistakes in the book or run into insurmountable issues. I do wish there were a few more reference YAML files though, that would mean I could compare images I generate with those in the book to make sure I really had things working correctly, not to mentioning actually defining correct camera and lighting properties is more challenging that you might think.

Rendering a sphere with reflection.
Rendering a sphere with reflection.

In short, I found this book fun. Really, really fun. It reminded me why I became a programmer in the first place. It also had the unexpected side effect of making me realise that I've been burning out for a while now doing the same old same old. I didn't expect a technical book to make me think about life choices!

I also can't stress enough how awesome the test driven format of the book is. It was quite something to implement a few tests, and just like that you have another amazing piece of rendering functionality.

Rendering a model made out of thousands of triangles.
Rendering a model made out of thousands of triangles.

Even though I've reached the end of book, this isn't the end of the story. At the time of writing this review, Jamis has also published 3 bonus chapters on the forums, one for creating bounding boxes, another for soft shadows and the third for texture mapping. I really can't wait to get that last one implemented! Some of the (low poly!) OBJ files I've tested also reference external materials and supporting these should be straightforward enough.

[This review is an abridged version of one I posted on my technical blog. See for the original review including more screenshots]

This post was first published Wednesday 14th of August 2019 and was last modified Wednesday 14th of August 2019 at 17:57:31.

Got something to say?

Leave a comment

Available formatting commands

Use Markdown commands or their HTML equivalents to add simple formatting to your comment:

Text markup
*italic*, **bold**, ~~strikethrough~~, `code` and <mark>marked text</mark>.
- Unordered item 1
- Unordered list item 2
1. Ordered list item 1
2. Ordered list item 2
> Quoted text
Code blocks
// A simple code block
// Some PHP code
[Link text](
Full URLs are automatically converted into links.

Replied on your own website? Send a Webmention!