BSDF clamp (no more fireflies)

Dear Arion customers,

What I am about to present here, may be one of the most important features in unbiased rendering ever. :-) Not kidding, probably.

This feature enters in the field of cheating, but the negative impact in the quality and purity of the render is often 0, while the benefit of removing fireflies entirely is probably the long lasting dream of every unbiased render engine user.

In most practical uses, the following is true:

With this feature, you can get rid of most (often ALL) of the fireflies in your render without (generally) affecting the render or losing visual components.

Here’s a visual example, rendered from a WIP kindly provided by Marco Podrini (podro).

Raw, unclamped scene. Lots of sun fireflies:

BSDF-clamped scene [clamp=8]. Identically-looking render, but the fireflies are gone:

How does this work?

WARNING: I will get a bit technical here. So read the conclusions in bold only if you want.

When a light path hits a surface, the mathematical model (BSDF) of the surface material is evaluated to determine the intensity and direction of the outgoing light ray. Since this is part of a stochastic (randomized) process, BSDF evaluation involves the material properties, and also some factors related to the probability of each outgoing direction. For this reason, likely paths usually evaluate to low-power BSDF values, and unlikely paths evaluate to high-power BSDF values.

That is perfectly normal and completely correct. Unlikely paths will output high-power samples, but will not happen often, so they will accumulate to normal-power values over time. In the same fashion, likely paths will output low-power samples, happening very often, so they will also accumulate to normal-power values over time.

Some unlikely (hard to generate) paths, such as complicated caustics, can be characterized this way. As a special case, fireflies could (in theory) be characterized this way too. As a matter of fact, they are very unlikely paths that happen sparsely, and carry a high amount of power that is expected to dissolve by accumulation over a long time.

Unfortunately, some completely legitimate paths fall into this category too. So simply removing such paths would kill fireflies at the expense of destroying many other legitimate visual components.

In v2.7.0 we have added a setting with which you can (optionally) constrain the output range of the RandomControl BSDF.

Note that the output of a BSDF is in the range [0..INF), despite most normal output values are in the range [0..1]. For this reason, using small clamp values (e.g., 4, 8, …) makes sense.

- The higher the clamp value is, the more power you’re letting through, and the less that you’re clamping.
- The lower the clamp value is, the more aggressively you’re clamping.

- Low BSDF clamp values kill fireflies very aggressively, but may darken some highlights in the scene.
- High clamp values leave the scene nearly (or completely) intact, but may let some fireflies through.

i.e., It is best to pick a BSDF clamp value that is high enough to leave the physical-correctness of the render as unaffected as possible, while removing as many fireflies as possible.

Here’s the same example as above, using an ‘excessively low’ [clamp=1] value. As you can see, fireflies are fully gone, but the frosted glass panel gets darkened a bit. In the render above, [clamp=8] was used, and fireflies were equally gone, while the brightness of the render remained completely unchanged.

BSDF clamp 1

This new feature, which is particularly effective in sun-lit scenes, will be part of v2.7.0 and be accessible in the upcoming Asa and Af3 Beta builds.

A couple more examples. This scene was kindly provided by Jose Manuel Linares (mane162) some time ago.

Unclamped (normal) version. Some sparse, but annoying speckles here and there:

Clamped version. Identically-looking, yet completely speckle-free:

Thank you very much.

Comments are closed.