24
$\begingroup$

In Cycles we have two options for sampling patterns. The default is Sobol, there is also Correlated Multi-Jitter.

The manual has this to say about sampling patterns:

Pattern

Random sampling pattern used by the integrator.

Sobol

Uses a Sobol pattern to decide the random sampling pattern used by the integrator. See Sobol sequence on Wikipedia for more information.

Correlated Multi-Jitter

Uses a Correlated Multi-Jitter pattern to decide the random sampling pattern used by the integrator. See this Pixar paper for more information.

After reading these links in the manual, it is not any clearer if one sampling pattern is better to use, or more efficient than the other for certain scenes, shader types, sample counts, or lighting setups, or any other factors.

What exactly is the difference between the sampling patterns available when rendering a scene in cycles? More specifically, why would one change it from the default Sobol to Correlated Multi-Jitter?

$\endgroup$
19
+200
$\begingroup$

In 2013 there was a long debate in a blenderartists thread, where some argued that for some scenes Correlated Multi-Jitter is better than Sobol, while others saw no real difference.

Cycles creator Brecht van Lommel was initially skeptic, he wrote:

These correlated multi-jitter vs. Sobol comparisons so far seem to confirm my own findings, which is that neither sampler is consistently better or particularly different even (...). Conclusion seems to be that the sampler sequence we have now is about as good as it's going to get, though it's nice to have a second good quality sampler implemented in the code as a sanity check for me.

But later he was convinced, and wrote:

Ah, I missed those comparisons. It seems indeed correlated multi-jitter is handling BSDF x mesh light source sampling better. Maybe that's something that can be fixed in Sobol, need to investigate.

One of the scenes where Correlated Multi-Jitter was better, was a diamond scene from BlendSwap. I wanted to see if the Sobol improved since 2013, so now (December 2016) I repeated the test with Blender 2.78a, but I still see a large advantage for Correlated Multi-Jitter.

100 samples, Sobol: enter image description here 100 samples, Correlated Multi-Jitter:
enter image description here

The rendering time with Correlated Multi-Jitter was 6% longer than with Sobol, but there is considerably less noise in the image. There are some fireflies, but they should be easy to filter in post, because their color so drastically differs from the surrounding pixels. Here's the Correlated Multi-Jitter post-processed with a very simple image filter that only removes single-pixel noise: enter image description here

On the other hand I saw no examples where Sobol was considerably better than Correlated Multi-Jitter, so in general it might be a good idea to change the default setting.

Also note that there is some work going on in the sampling area, for example Blue noised dithered sampling and Micro jitttered sampling. These are planned for 2017.

$\endgroup$
  • $\begingroup$ Can you elaborate on "a very simple image filter that only removes single-pixel noise"? $\endgroup$ – cegaton Jan 2 '17 at 16:01
  • 1
    $\begingroup$ @cegaton Thank you for the extra points :) About the filter: I didn't want to push my own software, but I actually wrote an open-source 2D image editor (Pixelitor, pixelitor.sourceforge.net), and I like to use it, because I know exactly how it works. This has a simple filter called "Reduce Single Pixel Noise" which for each pixel (and within a pixel for each R,G,B channel) examines the 8 neighbors, and if it's a minimum or maximum, the pixel value is replaced by the next minimum or maximum of the neighbors. Works only if the fireflies are not neighbors. $\endgroup$ – lbalazscs Jan 2 '17 at 19:48
10
$\begingroup$

Perhaps it will help you to know how sampling actually works:

When light is hitting a (let's say) diffuse surface, it is scattered in all directions. Each photon will leave the material in a different direction. Since the sun emits about 10^45 photons each second, consider this as an infinite amount. According to this, the following picture should have an infinite amount of arrows:

diffuse ray hit

Calculating the color of that surface point is basically an integration. (Let's leave out more bounces since each bounce of each ray has also to be integrated). Since there is no way to calculate this at all, Cycles uses the Monte-Carlo integration as an approximation of the end result.

Short version of the Monte-Carlo-integration: Use random sample points and integrate them (in this case by averaging them). According to the Law of large numbers, with time the result will converge.

But taking fully random points isn't that a good idea. So, Cycles instead uses a Quasi-Monte Carlomethod. The difference is, that it doesn't choose its sample numbers (pseudo-)randomly, and replaces them with less random, but better values. This makes sure for example that no region will be sampled significantly more often than others.

The pattern for getting the random values Cycles uses is called Sobol. Compare the two images in the the Wikipedia article and you can see easily why it is better suited. The pattern of Multi-jitter sampling looks really similar to the sobol one, that's why the difference isn't that noticeable.

Each pattern has two important properties: The speed at which it converges (the number of samples you need until it's more or less noise-free) and computation time. How the sequence converges depends heavily on the data you are integrating. That's why some scenes work better with one than another.

Sadly, I can't tell you how to chose your sampling pattern beside trying it out (yet).

EDIT

The paper about Correlated Multi-Jitter says:

We have presented a modification to jittering and multi-jittering that greatly reduces the noise in rendered images at higher sample counts while gracefully degrading to unstructured noise at low sample counts.

I found this comparison of both methods showing that there is a difference, but it is barely noticeable (to me, in that scene).

Also note from that answer:

For Sobol this works if the number of lights is a power of two, for Correlated Multi-Jitter it works for any number of lights.

This will affect how you set up your sample count depending on light count. For branched path tracing, it is different too.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.