Skip to content

Fireflies Filtering#

Physically-based renders can exhibit high contrast pixels that seem to be scattered randomly over the image. These bright spots are commonly called fireflies which are rendering artifacts resulting from paths that gives a poor estimation of the indirect illumination. For forward path tracers like like the path tracer integrator, these difficult paths are generally paths ending near light sources or caustics.

Example of fireflies in a render

Example of fireflies in a render

It's important to distinguish fireflies from general noise since they require a very large and impractical number of samples to be eliminated. More importantly, setting very large numbers of samples doesn't always solve the issue and worse, this can introduce new fireflies.

Another important thing to consider is that these paths are likely to exhibit high contrast noise when the number of bounces increases:

Cornell box rendered with 1 bounce of indirect illumination

Fireflies and high contrast noise visible with 10 bounces of indirect illumination

The approach widely used by renderers to eliminate fireflies is clamping the energy of all indirect paths on an arbitrary maximum value specified by the user. This biased method is simple and effectively reduces the number of samples needed to eliminate these artifacts.

However, not only aggressive clamping introduces obvious diffuse, reflection and transmission inconsistencies between direct and indirect illumination but also, it doesn't guarantee the elimination of fireflies.

For example, clamping the energy to the extreme value of 1 doesn't eliminate fireflies in the render below:

Clamping the energy to the extreme value of 1 doesn't eliminate fireflies in this render

Fortenutely, the path tracer of Clarisse is able to detect and eliminate paths that are likely to produce fireflies. Instead of clamping all indirect illumination paths based on an arbitrary maximum value, the user can control the threshold of the firefly detection using single attribute called Fireflies Filtering.

In the render below we disabled clamping and set instead Fireflies Filtering to 25%. Note how all fireflies have been removed:

Clamping disabled and Fireflies Filtering set to 25% Note that all fireflies have been removed

Compared to clamping, Fireflies Filtering dramatically reduces noise coming from indirect illumination when setting values beyond the default 25%.

All the renders below have been rendered with 64 spp and clamping disabled.

64 spp no clamping

64 spp no clamping and fireflies filtering set to 25% default

64 spp and Fireflies Filtering is set to 50% All rendering aretacts are gone

64spp and Fireflies Filtering set to 100% The render exhibits even less indirect illumination noise

It is important to note that high values of Fireflies Filtering can introduce a potential loss of indirect illumination energy since filtering these noisy samples also reduces their contributions from the final integration.

However, unlike clamping this loss of energy is reduced when the number of samples increases and gets closer to the unbiased result as you can see below:

Fireflies Filtering

Clamping 1

In the next example, the image is rendered with 16spp with an aggressive Fireflies Filtering value of 100%.

16spp Fireflies Filtering 100%

As you can see the image exhibits very little noise despite its low number of samples. However, it also exhibits a slight loss of indirect illumination energy when compared to the ground truth reference. Fortunately, as we will see this bias is reduced when the amount of samples is increased.

All the renders below have been rendered with a Fireflies Filtering set to 100%.

64spp

128spp

256spp

512spp

As you can see, rendering the image from 128spp to 512spp doesn't recover any missing energy so results are predictable with a somewhat small number of samples even with such aggressive value.