Path Tracing in Notch 0.9.23.

Path Tracing In Notch: A Primer

Notch
NotchBlog
Published in
5 min readOct 23, 2019

--

In the previous Notch release (0.9.22), we introduced real-time ray tracing. In 0.9.23 we have taken this a stage further and added support for path tracing, which enables near photo-realistic rendering in Notch.

In short, this takes the render quality possible in Notch forward towards photo-realism by a huge leap. Realistic reflections, refractions, light bounces and glass are now possible in the same interactive workflow as the rest of the Notch toolset.

The terms “path tracing” and “ray tracing” are often used interchangeably, but they mean rather different things; ray tracing is simply the process of shooting a ray from one position in the world to another and seeing what it hits. In 0.9.22, we made use of ray tracing to simulate some visually important effects which are hard to achieve without it and that were not previously possible in Notch: sharp shadows, diffuse and specular lighting from dome lights, and mirror reflections. It was a big step, but there was much further still to go.

Path tracing, on the other hand, describes a way of using ray tracing to simulate global illumination, and that’s where things get interesting.

Whenever we’re concerned with realistic rendering, we are really trying to simulate light: how it gets emitted from light sources, hits & interacts with surfaces and their materials, and bounces off again to hit something else. Direct illumination just deals with the first step: the first thing the light hits. This is the easiest and fastest thing to simulate, and thankfully also the most visually obvious; direct illumination is what basic Notch lights simulate.

But then the light bounces off the surface and may hit something else — and may do so multiple times. This is called indirect illumination: it’s the reason surfaces in complete shadow from direct lights are often not totally black. Some surfaces are matte and reflect light evenly in all directions, giving a soft indirect bounce; others are shiny and light bounces heavily in a single direction giving a clearly discernible reflection, e.g. mirrors. And some allow light to pass through, bending its path as it goes giving the appearance of transparency, e.g. glass. Global illumination is the combination of all of these lighting effects, direct & indirect.

Global illumination is almost impossible to solve or approximate generically: there are infinite possibilities for ways light can interact with scenes. Path Tracing is a way of solving global illumination by breaking it down into lots of individual paths: tracing a single ray from the camera into the scene, hitting surfaces, bouncing off multiple times, maybe eventually hitting some light. Add up the result of lots and lots of paths, and you get an image. With the right content, this accurate simulation of light can produce photo-realistic renders — which is pretty appealing, and why we really wanted to bring it to Notch.

Using path tracing in Notch is pretty simple: turn on Ray Tracing on the root node, make sure there are some lights and geometry in the scene, and add a Path Tracer node.

Path Tracing in Notch 0.9.23.

The existing node-set still works: the same light nodes, geometry nodes and materials as before (with a couple of new material additions). The same post effects, compositing, generators, cloners and procedurals all work exactly as they did before too. This is by design of course so that users can move between techniques depending on what they need for any given project or version of that project. Sometimes, a super-high res, high-quality render is needed. Other times, the scene needs to be running at interactive speeds, so path tracing can be disabled easily without the need to restructure the scene. Anyway, back to the topic at hand.

The most obvious immediate difference is that with path tracing on things like reflections, refractions and bounces “just work”: objects with metallic materials reflect the objects around them; objects with glass materials refract objects behind them. In many ways, path tracing is actually easier to understand and work with than the standard renderer.

The Path Tracer node is actually only concerned with indirect illumination. The direct illumination is controlled by the various light nodes — and we recommend that when working with path tracing, all lights are set to be ray traced for best results. Area lights and sky/dome lights benefit hugely from ray tracing.

Note that the path tracer only works on solid geometry: for transparent objects, use the Semi-Transparent RT Material or Glass RT Material nodes to simulate transparency with path tracing.

To achieve effects like mirror reflections and sharp shadows, we can shoot one ray — and, thanks to maths, we know exactly where to shoot it. But global illumination is more complex: to solve it accurately we really need to shoot an infinite number of paths in all directions. That’s somewhat impractical, so instead, we approximate it with quite a lot of paths in random directions. This has the potential to be rather slow: if it takes a while to shoot one ray, it’s going to take a thousand times longer to shoot one thousand of them; and you need at least that many to start smoothing out the noise. Simply put: path tracing is not, at present, targeted for real-time applications — but surely it’s only a matter of time?

The upside is that you don’t have to wait for all of those rays to start seeing your scene: the render refines over time, meaning that you see a noisy render straight away (often at real-time rates) that you can interact with and edit. Leave it alone for a bit and it’ll refine and smooth out.

For more information on refining and denoising techniques, see our companion blog post dealing exclusively with denoising.

--

--

Notch
NotchBlog

Notch is the game-changing real-time visual creation tool that keeps up with your ideas. Share your work with #MadeWithNotch