The Ray Tracer Challenge
Brace yourself for a fun challenge: build a photorealistic 3D renderer from scratch!
It’s easier than you think. In just a couple of weeks, build a ray tracer that renders beautiful scenes with shadows, reflections, brilliant refraction effects, and subjects composed of various graphics primitives: spheres, cubes, cylinders, triangles, and more. With each chapter, implement another piece of the puzzle and move the renderer that much further forward. Do all of this in whichever language and environment you prefer, and do it entirely test-first, so you know it’s correct.
Recharge yourself with this project’s immense potential for personal exploration, experimentation, and discovery.
Via Eli Bendersky, who blurbs it:
"The Ray Tracer Challenge" by Jamis Buck - this book guides you through implementing a ray tracer, using the programming language of your choice. The book is structured as a series of "unit tests" and pieces of pseudocode that are simple to translate into any language. It's very well-written and sequenced; it's fun to build something visual while learning a new programming language. I was somewhat disappointed that the book didn't spend more time explaining why the formulae and pseudocode it provides work, and didn't help develop intuition. This is by design - the author admits he's not going to do this right in the preface. This leads to a serious problem when debugging issues, though. Since no intuition is developed, the only way to debug is to meticulously compare your code to the book's pseudocode, to ensure that nothing got lost or mistyped in the transcription. I think this book is good but it could be much better if it spent more time on explaining the why, not just the how; it would be fine to trim out some of the advanced material if space is of concern.