# Why do even samples give less noise than odd samples?

I noticed that with some shaders, every other sample seems have less noise than the sample before and after it.

The shaders I noticed this with:

• SSS

• rough Diffuse

• Toon

• Translucent

• Velvet

For example, using the SSS shader:

Sample 1:

Sample 2:

Sample 3:

What is the technical reason for this?

Example .blend

• I would guess that switching to the Branched Path Tracer would yield different results. The regular Path Tracer chooses random things for each sample (a different shader for example, or perhaps a different piece of the SSS calculation). – Greg Zaal Feb 17 '14 at 11:21
• @GregZaal I thought the shader was randomly picked (or picked based on mix shader factors and stuff) per ray, perhaps I'm wrong? – gandalf3 Feb 17 '14 at 21:39
• Sounds like a question for Ton Rosendal. – Scalia Oct 15 '14 at 18:07
• @VinceScalia Or Brecht ;) – gandalf3 Oct 15 '14 at 18:54
• This question appears to be off-topic because it is a localized technical question. – someonewithpc Dec 1 '14 at 21:56

Sometimes it so happens that if the renderer has to sample N discrete things, and the number of samples is a multiple of N, then it can be that each thing gets exactly the same number of samples, which gives less noise.

With path tracing, each AA sample picks one light at random. If you have 2 lights with 2 AA samples then each light can be picked once, but if you have 3 AA samples then one light must necessarily get more samples than the other, which results in noise.

If Cycles used pure random sampling to pick the light for each AA sample this effect would not happen, with 2 AA samples a light might then get 0, 1 or 2 samples and it would still be noisy. However the Sobol and Correlated Multi-Jitter sampling distributions used by Cycles are such that each light does get exactly the same number of samples. 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.

For SSS it's more difficult to explain. We use ray tracing to find nearby points on the surface, where 50% of the rays are distributed along the direction of the normal, and 25% along two tangent directions. For flat surfaces only the rays along the direction of the normal will find points on the surface, and the sample distributions are such that an even number of AA samples will cause each pixel to hit the surface the same number of times.

That's the correct behavior. It samples one of the two lamps at random (unless you use branched path tracing). So at even samples it can sample both of them the same number of times, on odd samples that is not possible so there is noise from that.