When to use distance scrambling vs adaptive sampling

in what scenario is one better than the other

I’m going to assume you’re asking:

“When is it better to use Adaptive Sampling or Automatic Scrambling Distance if I want the best performance?”

I added the condition of Automatic Scrambling Distance to simplify things. And I’ve made this a question about performance as the goal of Adaptive Sampling and Automatic Scrambling Distance is to improve performance while maintaining good image quality.


Let’s start by explaining what each does:

Adaptive Sampling:
Adaptive sampling takes a look at your render during the render process and analyzes the noise in the render. If an area is deemed to be “within the set noise threshold”, adaptive sampling will stop sampling that area of the scene.

This can result in speed increases as with adaptive sampling some areas of the scene get lower sample counts than others, resulting in a faster render due to less overall processing. For example, a scene might render and the sky is rendered with 64 samples, a rock is rendered with 128 samples, some grass is rendered with 1024 samples, etc. Doing this is quicker than rendering the entire scene at 1024 samples, all while hopefully looking very similar in terms of noise level.

Automatic Scrambling Distance:
Automatic Scrambling Distance reduces the randomness between samples of neighboring pixels. This, in combination with some other code changes, increases correlation between pixels, which results in better utilization of cache on your rendering device, resulting in reduced need to gather information from VRAM/RAM, resulting in improved performance. The reduction in randomness between samples of neighboring pixels is automatically picked when Automatic Scrambling Distance is enabled such that the final render generally looks the same as it would if the setting was off.

At the moment Automatic Scrambling Distance has only been found to provide a performance increase when rendering with the GPU. Rendering with the CPU sees very little to no performance increase compared to having the setting off.

From my own testing, I’ve also found that a sample count of 64 or higher is generally needed for Automatic Scrambling Distance to provide a performance increase. And with a higher sample count, the greater the performance increase. (E.G. At 64 samples, you might get a 1% performance increase by turning on this setting. But at 4096 samples you might get a 20% performance increase)


Now onto “which is better”.

Let’s start with a simple thing. If you’re rendering with your CPU, and CPU only, then Adaptive Sampling will generally be better for performance than Automatic Scrambling Distance. This is because Automatic Scrambling Distance has no measurable performance benefit for CPUs while Adaptive Sampling does. This may change with future generations of CPUs. But at the moment this is the case.

If you’re rendering with your GPU, then you can start to investigate which one is better for performance.

Generally speaking, if Adaptive Sampling ends up bringing the majority of the image to roughly the same sample count (E.G. 80% of the image is in the range of 1800-2200 samples), then changing your sample count to the middle of that range (2000 samples) and enabling Automatic Scrambling Distance will generally result in better performance with comparable image quality.
However, if Adaptive Sampling renders the image with a really wide range of sample counts (20% is at 4000 samples, 30% is at 2000 samples, 30% is at 1000 samples, 20% is at 500 samples) and these sample counts are justified to achieve the required noise level, and a large portion of the image is complex to render (E.G. Requires light bounces to render), then Adaptive Sampling tends to be better for performance at the same quality when compared against Automatic Scrambling Distance.

These are just general rules though. And there may be other situations where one is better than the other in terms of performance or noise level.

One last thing though. If you’re rendering an animation with the Animated Seed parameter turned on, then I’ve personally found Adaptive Sampling to produce a more temporally consistent result than Automatic Scrambling Distance and as such would recommend Adaptive Sampling for animations with an animated seed. But I might just be mis-remembering things.

11 Likes

thanks for the detailed answer.

i came up with some follow up questions,

why scrambling distance cant be used together with adaptive sampling?

which is better sobol or pmj for both method

is scrambling distance performance increase depends on how much VRAM is used? for example a scene that uses a lot of vram will get a better performance increase. a scene that uses very little vram will have little benefits
what if I used all the VRAM and started to use a lot of the system memory? will scrambling distance be less effective in that case?

thanks

Rendering artifacts can occur when you combine the two. I have created a patch that tunes the Automatic Scrambling Distance setting to avoid the artifacts here: âš™ D13325 Allow Enabling Adaptive Sampling with Scrambling Distance If this patch gets accepted by the Cycles developers, then you can enable both at the same time.

With Adaptive Sampling, you don’t have a choice, PMJ is used if Adaptive Sampling is on.
As for Scrambling Distance, I don’t know which one is “better”. However, since the Cycles developers want PMJ to be the default in all situations, I suspect PMJ is “better” in some way.

I don’t know the answer to this. Sorry.

3 Likes

thanks for the answer

I just wanted to add that the Scrambling Distance option can be great for certain NPR renders.

This is an example of a scene I made where I was experimenting with developing a concept art style of rendering:


It really cuts down on the noise (and with lower samples required!), while at the same time introducing splotches of light that give hints of a digitally painted look. I’m not sure if this holds up with higher resolutions, but it works well for my lowres, pixelated workflow.

(Original game art is from a game made by Sierra On-Line back in 1989.)

1 Like