No Plans For The Weekend? Learn Raytracing!

Weekends can be busy for a lot of us, but sometimes you have one gloriously free and full of possibilities. If that’s you, you might consider taking a gander at [Peter Shirley]’s e-book “Learning Raytracing in One Weekend”.

This gradient is the first image that the book talks you through producing. It ends with the spheres.

This is very much a zero-to-hero kind of class: it starts out defining the PPM image format, which is easy to create and manipulate using nearly any language. The book uses C++, but as [Peter] points out in the introduction, you don’t have to follow along in that language; there won’t be anything unique to C++ you couldn’t implement in your language of choice.

There are many types of ray tracers. Technically, what you should end up with after the weekend ends is a path tracer. You won’t be replacing the Blender Cycles renderer with your weekend’s work, but you get some nice images and a place to build from. [Peter] manages to cram a lot of topics into a weekend, including diffuse materials, metals, dialectrics, diffraction, and camera classes with simple lens effects.

If you find yourself with slightly more time, [Peter] has you covered. He’s also released books on “Raytracing: The Next Week.” If you have a lot more time, then check out his third book, “Raytracing: The Rest of Your Life.”

This weekend e-book shows that ray-tracing doesn’t have to be the darkest of occult sciences; it doesn’t need oodles of hardware, either. Even an Arduino can do it..

14 thoughts on “No Plans For The Weekend? Learn Raytracing!

  1. It is funny this reminds me of when I was using https://www.povray.org/ in the 90’s you would setup your 3D space with the objects that you would like to see in the final image then you would kick off your render and go to bed and if everything went well you might see an image the following day before going to bed :)

    How times have changed.

    1. The best thing with POV in the 90s was the rendering times.
      I can remember waiting a week for a 800*600 version of the tittle picture to be rendered on my Atari STF …
      Those where the fun times …

      1. Oh yes…i used to use it to make animation frames that I would put into the SIRDS converter. Not sure i ever really saw it 3d properly but fun anyways

      1. It ran 1996-2006!
        I have one of the winning entries (“The wet bird” by “Oyonale”) on my wall and often get asked about the “photo”.

  2. The code is pretty much prime example of how to NOT do things. Overuse of shared pointers, impractical scene representation, incorrect materials, and wrong sRGB/linear handling of texturesm

    All it’s going to teach you, is bad coding habits and incorrect assumptions about physically based rendering.

    1. Can you make a tutorial? It would be nice to see you make a better setup, teaching good habits and the best frame of thought for physical based rendering.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.