Raytracing is now available in Notch 0.9.22.

Ray tracing — the Notch way

Incredibly powerful and high-quality rendering, directly in Notch.

Published in
5 min readJun 6, 2019

--

With the release of Notch 0.9.22 today comes the first in a set of features that enables raytracing in Notch. This blog post is going to elaborate on our thinking around ray tracing, how things work, and what’s to come.

Hardware Requirements

Our ray tracing implementation is hardware agnostic and runs entirely on the GPU. It does not require any special hardware (like NVIDIA’s RTX platform) or DirectX 12 (DXR) but is written so that we can take advantage of those technologies in the future, as they mature. As such, if you already have a GPU that currently runs Notch well, you can use ray tracing.

Keep in mind that ray tracing will not be suitable for every project or every GPU — particularly those running in real-time at high resolution — but even in non-realtime settings, it’s an incredibly powerful tool (for baking high-quality textures, and for rendering to video).

Ray Tracing Use Cases

Ray tracing brings to Notch a number of features not previously possible with the traditional rasterizing renderer and greatly improves others.

Notch 0.9.22

In this release, accurate one-bounce reflections are now possible; area lights can cast shadows; and spot, omni & skylight quality can be improved greatly by using raytraced shadows instead of shadow maps.

In order to take advantage of the improved render quality offered by ray tracing even in real-time targeted scenes, a new baking workflow to cache lighting to textures has been developed and is also available in 0.9.22.

What’s Coming

We have further ray tracing features in advanced stage of development that will ship in Notch 0.9.23, which opens up some exciting new possibilities: support for multiple diffuse & specular bounces; refraction, transparency & glass; and ultimately a full path tracer, complete with interactively refining rendering similar to that seen in other well-known ray tracing renderers.

Using Ray Tracing Features & Nodes

Ray tracing in Notch is modular: you can add it to existing projects and enable select features at will. It does not completely replace the existing renderer & node set, but augments it and works with it.

In order to use ray tracing in a layer, the “Ray Tracing” checkbox must be ticked on the Root Node. Note that enabling this causes the ray tracing structure to be built every frame, regardless of eventual use — which may have a significant performance impact. It should only be enabled when ray tracing features are in use.

There is an additional “Dynamic” option which, if unchecked, will cause the data structure to never be updated — a useful optimisation for entirely static scenes only.

Note: Deferred Rendering must be active to enable ray tracing.

Lights

“Ray Traced” options are now available on Sky Light, Area Light, basic spot/omni Light and Directional Light nodes. When this option is enabled, the light is rendered using ray tracing rather than traditional shadow maps.

HDRI lighting is used alongside raytraced shadows and denoising.

Ray tracing is generally slower than using shadow maps — but in some cases may actually be faster, depending on scene complexity. Limit the attenuation of lights to improve performance.

Mirror Reflections

The RT Mirror Reflections node uses ray tracing to produce a one-bounce sharp mirror reflection on shiny surfaces. This is likely to have a significant performance hit but may be usable even in real-time projects. Rays are only cast for reflective pixels on the screen, so reducing the size of reflective surfaces may improve performance.

Raytraced reflections are great for car models and other shiny materials.

Mirror reflections in most cases do not require denoising or refining as they’re sharp; one ray per pixel is sufficient. The exception is when mirror reflections see bounces from lights with raytraced noisy shadows. To enable denoising/refining on the Mirror Reflections there is a checkbox on the node.

Materials

A new set of material nodes have been added which simplify the setup of common surface types, including when used in ray tracing scenes.

Refining & Denoising

Ray tracing is computationally intensive and some effects — such as soft area light shadows — rely on lots and lots of rays being cast per pixel. In order to make this viable in real-time or while editing interactively, Notch typically casts very few rays per pixel but uses denoising or refining to aggregate the results over time.

Refining simply rerenders the same view repeatedly but with different ray directions, and averages the results to create a smooth, accurate render. If the play head, the camera, or any objects move, the refining resets and the aggregated result is lost. A new button in the GUI has been added which allows you to toggle infinite refining on and off.

Toggle refining with this switch.

Denoising is available via the RT Denoiser node and attempts to handle moving objects and views using motion and spatial coherence. While imperfect (it can lead to ghosting and bleeding artefacts), it allows a moving scene to appear refined. With no RT Denoiser node present, the default behaviour is Refining.

The RT Denoiser node is used to control denoising parameters throughout the scene.

Baking

0.9.22 allows you to take static elements in your scene and bake various forms of view-independent diffuse lighting, shadows and ambient occlusion. By removing these calculations for these static elements you can achieve very high-quality lighting looks and even combine baked lighting with other dynamic real-time lights.

This works for any lighting in Notch — but is particularly applicable with slower, higher quality raytraced lighting setups.

“Ando’s House” — one of the additional samples you can download.

The Bake Lighting To Object node allows lighting to be cached for a single 3D object.

Baking is only really suitable for static geometry and requires that your imported meshes have well-formed UV maps to bake to. Note that this makes it unsuitable for any generative meshes (Shape 3D, Text etc), cloned objects, dynamic objects or deformed objects.

Examples

With this release ships a series of examples that highlight the two most important ray tracing features, and we encourage you to give these a go and check out the nodes used. In addition to the examples that ship with the Notch Builder 0.9.22 installer, we also have an additional pack of larger samples which you can download here.

We highly recommend you take a look at the full changelog for the 0.9.22 release, and as always: let us know if you encounter any issues.

--

--

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