Moments in Graphics
A blog by Christoph Peters

Path tracing workshop

Published 2022-12-20

Now that GPUs have ray tracing units, real-time path tracing is coming into reach. Applications beyond movie rendering and baking embrace it, and therefore more people need to know about it. At Intel, I recently offered a path tracing workshop to educate a broad audience of engineers on basics of the topic. I am happy to announce that we decided to make this workshop publicly available. If you know a few math and programming basics, you can watch 76 minutes of videos and solve some exercises on ShaderToy as you go. In the end, you will have written your own ray tracer and a path tracer on top of it! I simplified things as much as possible, but you will really write all key aspects of the path tracer and understand why they work.

Part 1: Ray tracing

Part 1 is about bare bones ray tracing. You learn how to use GLSL and ShaderToy. As first proper exercise, you have to compute camera rays for a virtual camera. Then you implement ray-triangle and ray-mesh intersection tests and you have got a ray tracer. It is slow, because it does not use acceleration structures but it works correctly and can render scenes without any shading as shown in Figure 1.

Figure 1: The end result in part 1 of the workshop is a ray traced Cornell box without shading.

Part 2: Path tracing

Part 2 is about basic path tracing. This part has a bit more theory because you need to understand concepts like radiance, the rendering equation and Monte Carlo integration. Then you learn how to generate random direction vectors in a hemisphere and use them to compute direct illumination using Monte Carlo integration. Finally, you implement path tracing and get the image in Figure 2 (if you ramp up the sample count enough).

Figure 2: The end result in part 2 of the workshop is a Cornell box with full global illumination rendered using path tracing.

Part 3: Importance sampling?

Parts 1 and 2 take the path of least resistance to arrive at a path tracer that functions correctly. The drawback of its simple design is that it converges rather slowly. Importance sampling strategies are an excellent way to make it faster. I already wrote a blog post or two and a few papers on this subject. If things go well, there will be a part 3 covering light sampling, BRDF importance sampling and multiple importance sampling. Stay tuned!

Please let me know by email if any of these links are broken.