Skip to content

Introduction#

The path tracer of Clarisse solves global illumination using unidirectional path tracing. It simulates real world materials by sampling multiple BxDFs, simulates both reflective and refractive caustics and supports multiple importance sampling.

Dark Force

The way a path tracer estimates global illumination is surprisingly simple and elegant. Paths are generated from the camera and they continue to bounce on the materials of the scene according to their property.

At each bounce, lights are sampled to estimate direct illumination and materials are sampled in order to evaluate the probability and the direction of the next bounce.

In a nutshell, the path tracer starts by launching a ray from the camera, hits a surface, samples lights and materials and continues until either the path reaches the maximum number of bounces or when absorbed which happens when hitting a pure emissive surface or the background.

Note

Interestingly, you will note that the path tracer works in backwards compared to the current physical model where illumination (photons) travels from the scene to the camera. The reasoning behind this backward strategy is based on the fact that a only small fraction of the paths originating from the scene really ends up to the camera. Indeed, by tracing paths backwards, the path tracer only computes the meaningful information that is really contributing to the image and obviously, less computations directly translates to faster render times.

Example of paths in a path tracer

Example of paths in a path tracer

As we can see there are 3 fundamental types of paths to consider in a unidirectional path tracer:

  • camera paths are paths that originate from the camera and intersect a geometry of the scene (shaded point). The number of camera path is directly controlled by the Anti Aliasing attribute of the raytracer. Please refer to the Anti Aliasing section for more information.
  • direct paths are paths that originate from lights towards the shaded point. The number of direct paths is controlled by the Sample Count attribute on lights.
  • indirect paths are paths that originate from shaded point and go toward the scene according to the property of the materials . The number of indirect paths generated from the shaded point is controlled by the Material Sample Count attribute. The number of times the path bounces in the scene is controlled using a specific set of attributes. Please refer to Indirect Path Depth for more information.

Please note that this is slightly oversimplified since direct paths are actually evaluated at each bounces.

Material Sampling#

Attributes controlling material sampling are regrouped in a category where you can control the number of samples used for material sampling as well as multipliers to fine tune the number of samples used for each ray type.

Tip

Material Sampling attributes can be locally overridden at the material level for finer controls.

Material Sample Count#

To increase sampling quality and reduce noise, you need to raise Material Sample Count. The input value is in sample per pixel (spp) which corresponds to the actual number of samples used per pixel for material sampling.

Increasing this value globally increases the number of samples used to solve global illumination, reflections and transmissions for both specular and glossy rays. This value basically defines the number of paths that are spawned from the surface. This value also defines the sampling budget that is used for all materials in the scene.

Alpa Full

The actual number of samples used for each ray type is automatically dispatched between the different ray types. Obviously, increasing Material Sample Count value ultimately increases render times.

Note that Material Sample Count doesn't affect direct light sampling. You still need to tweak the number of samples for each light in order to reduce noise coming from lights.

=== "Material Sample Count 1 spp (2.5s) Material Sample Count 1 spp  25s

Material Sample Count 16 spp  19s

Material Sample Count 64 spp  41s

Material Sample Count 256 spp  87s

Note

The heuristics dispatching the number of samples over each ray type can be fine tuned manually using sampling multiplier attributes dedicated for each ray type.

Material Sampling Multipliers#

By default, samples are automatically allocated to the different BxDFs according several heuristics and importance sampling. While this works pretty well most of the time, this automatic sample allocation may not always be suited to certain material/scene configurations.

For example, while the diffuse term of a reflective and diffuse material can be very strong, the actual energy received from diffuse lighting on the same material can be very low due to shadowing.

In this case, the reflection term should become predominant. Since the path tracer has no knowledge of the actual illumination when sampling the material, it is possible to increase the number of samples on specific channels to help the path tracer to resolve global illumination more efficiently.

Attribute Description
Diffuse Sampling Multiplier Multiply the number of samples allocated by the sampling heuristic when the material computes indirect diffuse illumination
Glossy Reflection Multiplier Multiply the number of samples allocated by the sampling heuristic when the material computes glossy reflection illumination
Glossy Transmission Multiplier Multiply the number of samples allocated by the sampling heuristic when the material computes glossy transmission illumination
Subsurface Sampling Multiplier Multiply the number of samples allocated by the sampling heuristic when the material computes subsurface scattering.
Volume Sampling Multiplier Multiply the number of samples allocated by the sampling heuristic when shading volumes.

The best way to identify the source of the noise due to under sampling is to make a render preview while outputting the AOVs channels (reflection, diffuse, transmission, subsurface) at the same time.

For more information, please refer to Optimizing Clarisse Render Times.

In this render we can see quite a lot of noise

In this render we can see quite a lot of noise

diffuse AOV no noise

specgloss AOV visibile noise

Setting Glossiness Reflection Sampling Multiplier to 4.0x resolves the noise

Setting Glossiness Reflection Sampling Multiplier to 40x resolves the noise

Indirect Path Depth#

There are 2 main types of paths in Clarisse: direct and indirect paths. Direct paths are paths to the lights originating from the surface hit by the camera ray whereas indirect paths are paths that are bouncing multiple times in the scene according to the material properties.

The path tracer provides a set of attributes allowing you to control the depth of paths for each path types. Please note that the higher the depth, the longer the render time gets. There are 5 types of possible paths in the path tracer:

Attribute Description
Diffuse Depth Control the depth or number of bounces of the diffuse reflection (indirect lighting). To disable diffuse reflection or indirect lighting just set the Diffuse Depth to 0.
Specular Reflection Depth Control the depth of the specular reflection (number of recursion in mirrors). To disable specular reflection just set Specular Reflection Depth to 0
Glossy Reflection Depth Control the depth of the specular reflection (number of recursions in rough reflective surfaces). Due to the nature of the blurry reflection, this figure can be set usually lower than the specular one To disable glossy reflection just set Glossy Reflection Depth to 0
Specular Transmission Depth Control the depth of the specular transmission (number of recursion in perfect glass). To disable specular transmission just set Specular Transmission Depth to 0
Glossy Transmission Depth Control the depth of the glossy transmission (number of recursion in frosted glass). To disable glossy transmission just set Glossy Transmission Depth to 0
Volume Depth Control the depth or number of bounces of diffuse reflection (indirect lighting) in volumes and transmission scattering (which are considered as volumes).
Total Maximum Depth Set the maximum depth of all paths whatever their type.

Path Splitting#

Path Splitting is a rendering technique aimed at reducing noise in renders. The idea behind path splitting is to split the incoming path into multiple ones when bouncing a material that defines pure specular BSDFs.

For example, an incoming path can hit a material defining a diffuse and a pure specular lobe (mirror like) for clear coat. If no path splitting is performed, the path tracer will select one of the two lobes and continue the path. This obviously can lead to noise since one of the component (and specially the specular one in that case) is not always guaranteed to be sampled.

When path splitting is enabled, the incoming path is split in two new paths so that both lobes are ensured to be sampled. While this technique certainly reduces noise, it can dramatically increase render times! Indeed, if the path is split in two at each bounce, this quickly leads to the explosion of the number of paths!

To avoid this issue, the path tracer provides a special attribute called Maximum Splitting Depth. This attribute controls the maximum depth at which the path tracer is allowed to split a path. By default, the Maximum Splitting Depth is set to 1, which means that the path is only split the first time it samples a material that requires it.

Maximum Splitting Depth 1 (default)

Maximum Splitting Depth 1 default

When Maximum Splitting Depth is set to 0 some noise appear on the light reflection

When Maximum Splitting Depth is set to 0 some noise appear on the light reflection

When you disable path splitting by setting Maximum Splitting Depth to 0, increasing the Material Sample Count reduces the noise.

Maximum Splitting Depth 0 Material Sample Count 64 spp

Maximum Splitting Depth 0 Material Sample Count 256 spp

Russian Roulette#

Russian roulette is an unbiased technique that reduces render times by terminating paths before they reach their maximum depth. In a nutshell, the chance of a path to be terminated increases each time a ray bounces on a surface since deep paths are less likely to contribute than shorter ones.

While Russian Roulette can improve render performances, it isn't a noise reduction technique. On the contrary, Russian Roulette introduces noise. In the example below adding some Russian Roulette slightly reduce render times.

Image rendered without russian roulette

With russian roulette the render is faster with no visible difference