I have added the support for convergence based adaptive sampling to RANDOM and SOBOL sampler.
The problem
While SOBOL sampler has a good stratification, it uses the same number of samples for each pixel. This is the new SAMPLECOUNT AOV showing the number for samples for each pixel, darker means less sample, brighter means more:
Not very interesting All pixels have the same amount of samples so the image is just flat gray. Let's see how METROPOLIS sampler works. Metropolis "seeks" light and it uses a number of samples for each pixel proportional to the pixel luminance:
It works exactly as expected. However it isn't so smart, for instance, it samples the sky a lot because it is bright but it has zero noise and could be rendered with just one samples per pixel.
TILEPATH already has the support for adaptive sampling:
however, its work is based on tiles so it can not refine very much its work aside from sampling less the sky and some other zone.
The solution
Convergence based adaptive sampling for SOBOL (and RANDOM) samplers, uses a number of samples directly proportional to how far is the pixel from the convergence threshold:
As you can see, it works very well here. It uses a vary small amount of samples for the sky, the mirror, etc. (darker means less samples, min. samples count 193) and a lot of samples for the caustics (max. samples counts 2106).
The race
But in practice how much rendering time can it save ?
This is normal SOBOL:
Rendering time => 261 secs
Samples per pixel => 9136
This is METROPOLIS:
Rendering time => 600 secs
Samples per pixel => 16963
Why is it so bad ?!? Because it is trapped in its obsession for light and brighter zones. A zone like the one circled in red will receive less samples because it is darker but is also the part of the image with more noise.
This is new SOBOL with convergence based adaptive sampling:
Rendering time => 145 secs
Samples per pixel => 4843
Yes, it can be that good, it achieves the same level of convergence while being 1.8 times faster and using 47% less samples.
Conclussion
The adaptive mode is now enabled by default both for RANDOM and SOBOL sampler. There is only one additional parameter:
Code: Select all
sampler.random.adaptive.strength = 0.7
# and
sampler.sobol.adaptive.strength = 0.7
The adaptive mode is based on convergence test, if you don't directly enable the convergence halt condition, the sampler will use a test with a threshold of 0.02 as default (but will not stop the rendering).
P.S. a note about convergence threshold: it is written as 0.02 but should be read as 5.12 level difference in an 8bit RGB color. It is a lot easier to understand if it is seen as a value between 0 and 255 divided by 256.