Dithering

To further reduce necessary sampling count per pixel I have started to look at a simple technique called Interleaved Sampling, where the samples of a whole ray can be distributed among several adjacent pixels.

Conceptually, Interleaved Sampling in the context ray marching can be thought of as distributing a ray evaluation amongst several pixels; one pixel in a small grid of adjacent pixels will take some parts of the needed samples, and other pixels will take the rest.

In practice it is very simple, because what you do is that you simply offset the starting position of a ray march according to its position in a small interleaved grid. If we use an N \times N interleaved grid on a W \times H accumulation buffer, position as fmod(screen_position.xy). The interleaved position is transformed into 1D, yielding an index 0 < i < N^2 which is then used to offset the starting position of the ray.

 

 

halfres_8x8_noblur

Without any modifications, the artifacts introduced by this approach is of course very severe.

 

halfres_8x8_7tapgauss_stddev5

But an additional blur pass does a surprisingly well job of hiding this.
What we can do now is also to have a slightly randomized dithering pattern, trading the very noticeable repeatable artifacts with less noticeable noise:

halfres_8x8_bayerdither

 

And with gaussian blur:

halfres_8x8_bayerdither_7tapgauss_stddev3

 

All the above images were rendered with a half resolution accumulation buffer and bilateral upsampling.