At the start of this year (2025), I had a lot of fun following some tutorials on Raytracing. Regardless of how much I’ll use this knowledge down the road, I can’t stress enough how interactive and engaging writing code for graphics is as someone who hasn’t before. Even if not the same one I did, I really do recommend trying it out.

This also served as an excuse to try to firm up my very loose C++ ‘skills’ and gain some more knowledge around how to work with it performantly and safely.

Another point of inspiration was a tigsource forum thread from Lucas Pope (dukope) that showed up on HackerNews. The thread showed off a demo, and detailed his work in getting towards consistent dither moving with geometry in game.

The tutorial in question was Ray Tracing in One Weekend by Peter Shirley, Trevor David Black, and Steve Hollasch. Following this was a fun exploration into building a path tracer from scratch, and was very well taught and explained.

This was my final render. It’s almost identical to Shirley et al.’s sample render, but since I finished off the last few chapters while acting as an organiser for Brighton’s Global Game Jam site, I added a bubble to try to scrape my way on-theme a bit. This isn’t actually a bubble though, as explained by the authors earlier in the tutorial, you can create a bubble-like object by placing a sphere of air inside a sphere of glass, as their relative refractive indices will have this effect.

Many small spheres of varying colours, along with a big bubble-like sphere, polished metal-like sphere, glass sphere, and brown opaque sphere, on a flat grey floor, with a white sky behind them. There is a blur around the edges of the image as if it was taken by a real camera. All of the spheres are reflected in the bubble, metal, and glass spheres.

If you’re wondering whats with all the spheres, you’re not alone. Raytracing in One Weekend deals exclusively with spheres as they’re a nice easy primitive to start working with. Its sequel book, Ray Tracing: The Next Week dives in much deeper and shows how to make some more primitives like cubes and quadrilaterals, as well as materials like noise and texture maps and volumes, as well as adding in lighting and motion blur (“SpaceTime Ray Tracing” is a ridiculously cool name).

Like with my last one, I added one thing to my final render not seen in the sample one, since I didn’t want the smoke cube to miss out on the fun:

Lit by a single square light at the top of the image, several spheres and cubes hover above a floor of green cubes of diffing heights. One sphere is brown and in motion from left to right, another has an image of the earth as its texture, another is glass, another is emissive and reflects light like glass despite being a deep blue, another has a noisy black and white pattern circling it, and the last is metallic but very dull so reflects little. The cubes sit behind the spheres, one made of spheres itself, looking like a packed box of styrofoam, and the other, a solid block of fog or steam that absorbs the light and hides the dark grey background from view.

I haven’t yet got round to the third and final entry in the Raytracing series (Ray Tracing: The Rest of Your Life), but I do intend to at some point. The authors promise that it covers optimisation in a big way.

Shirley et al.’s tutorials have made the concept of graphics programming very accessible to me - and they even reference interesting literature from the area too! Fascinating papers like Distributed Ray Tracing by Robert L. Cook from Pixar, and the furious yet justified A Pixel Is Not A Little Square, A Pixel Is Not A Little Square, A Pixel Is Not A Little Square by Alvy Ray Smith.

Thanks for reading!

All my code is available on GitHub below, but please do have a stab at them yourself first! In One Weekend The Next Week