Raytracers are one of those cool programs that you can write in a few hours and already have something fun to play with. I never got to write one at school so I figured I would spend a day or two and get one going!

Because many other sources recommend it, I downloaded Peter Shirley’s book Ray tracing in one weekend and gave it a go. Even though I was familiar with the concepts, it was a good exercise and also surprisingly fun!

I’d really recommend this book since it gives you enough knowledge to get things going without drowning you into too much implementation details. You’ll get to practice basic matrix transformations, ray intersection maths, random distributions, surface shading amongst other topics.

As a reference I’ve put the full source code of my implementation on GitHub.

Render