32 refine steps (noisy) vs 32 refine steps + denoising.

Denoising Explained

Notch
NotchBlog
Published in
5 min readOct 22, 2019

--

Ray tracing is good at making things look sharp. A single ray, cast from a light through geometry, knows exactly what it hits along the way — allowing it to generate a perfectly sharp shadow.

A ray bouncing off the surface of an object then hitting others can be used to create a perfectly sharp reflection. Single rays are also pretty fast to shoot, making effects like hard directional shadows and mirror reflections, which only need a single ray per pixel, viable in real-time.

Path tracing is included in Notch 0.9.23, which is available now!

But sharp isn’t always desirable; sometimes we want soft, fuzzy, blurry, smooth — but individual rays don’t know how to do that. To achieve these effects we have to cast loads of rays, in slightly different directions and average out the results.

..and that is where ray tracing gets slow. While a result that is usable for editing and pre-visualisation may be obtained quickly with just a few rays, getting soft, noise-free results need an awful lot more. If one ray per pixel runs in real-time, thousands of rays per pixel will be thousands of times slower than real-time.

This is where denoising techniques come in. These attempt to take the results of relatively few rays and apply filters or other methods to turn it into a smooth result that should have taken many more rays to achieve. There are several options for denoising in Notch, available via the RT Refinement node and the RT Real-Time Denoising node.

RT Refinement node settings.

Refining is the default behaviour. This simply renders the frame over and over again using different ray directions each time and averages the results. The render is accurate — there’s no filtering in use, just lots of rays. If anything moves, the scene animates or any properties change, refining is reset. This is great for rendering still frames (via Render Still in the File menu, or using Shift-F8), or for editing interactively.

The maximum number of passes can be set: when this number is reached, rendering stops. When rendering video or stills, the Raytracing Passes option in the Export Video dialog defines the number of passes per frame. For path tracing, anything from 100 to 10000 passes will typically be needed to achieve a reasonable result, depending on your scene.

There are some additional options on the RT Refinement node regarding spatial filtering. This applies a filter a bit like a blur that smooths out the results between neighbouring pixels, which can be great to remove the last bit of noise, particularly with soft/diffuse surfaces. It could be the difference between needing 100 passes and needing 1000.

The RT Real-Time Denoising node introduces a technique for denoising which is suitable for real-time, building on state of the art research in the field (ASVGF filters). It combines a spatial filter as on the RT Refinement node, with a temporal filter: in short, it reuses information from previous frames.

This allows just a few rays per frame to be shot, and a smooth result will build up over a few frames. Camera animation and diffuse surfaces typically fare well, but moving objects and glossy reflective/refractive surfaces have significant issues such as ghosting. The quality compromises make it only really suitable where interactive frame rates are a requirement.

The RT Refinement node contains another option for denoising: AI-based denoisers. Notch supports two: the CPU-based Open Image Denoiser (OIDN) by Intel, and the GPU-based OptiX denoiser from NVIDIA.

AI-based denoisers use an entirely different approach to denoising. They use machine learning which has been pre-trained on a series of images that show a noisy version of a render (after a few iterations) and the fully refined version of that render — in effect teaching the AI how to take a noisy, unrefined image and turn it into a refined version of that image, like magic.

Both OIDN and OptiX achieve remarkable results. While they will still produce results with just a single refinement pass they do best in conjunction with some refining: denoising an image with 50–100 refinement passes often produces a very viable, smooth result.

NVIDIA OptiX denoiser.

The OptiX Denoiser requires a very recent NVIDIA driver (435.xx or later) and at least a 10-series NVIDIA GPU. It can produce a result in near real-time. The OIDN denoiser runs on the CPU and is considerably slower at around 1 second for an HD frame. Both are well worth experimenting with.

Intel OIDN denoiser.

AI denoising is applied on a frame by frame basis: there is no temporal information fed into the technique and each frame is evaluated independently. As such, when used for video exports it can cause temporal shimmering. This can be mitigated by applying temporal antialiasing on top but can be a significant obstacle in production use.

In an ideal world, final rendering of video or stills would rely on refining alone, allow as many iterations as needed to make the result smooth, and take as long as it took. This will always achieve the best quality results. But in the real world where time is not unlimited, or for pre-visualisation, denoising can dramatically reduce render times and still give you a great looking image.

--

--

Notch
NotchBlog

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