Saturday, April 28, 2012

Killing Fireflies

The cure for MLT fireflies is actually easy: limit the maximal number of sequential mutation rejections.  I saw this while reading the PBRT Metropolis code and, by chance, decided to give it a shot.  Sure enough, it turns out that almost all of the fireflies that I was observing were due to the path getting "stuck" in bright areas and rejecting a lot of mutations in a row.

Here's a comparison.  The image below was given 30 seconds to render, and has no rejection limit:


Here's the same scene, also given 30 seconds to render, with a rejection limit of 32:


Notice that pretty much all of the fireflies disappeared!  For reference, here's the same scene given 30 seconds of brute-force path tracing:


The difference between MLT and brute-force in this instance actually isn't that profound.  Although the MLT shots still look better, the difference really becomes evident after longer running times, when path tracing continues to waste time on unimportant areas, while MLT continues to allocate samples intelligently - the gap grows ever wider.

No comments:

Post a Comment