Table of Contents
Brazil r/s Tutorials Brazil r/s 1.x

Forcing GI singlesampling of a GI-undersampled render By: Richard Annema

When undersampling the GI in a scene, You may encounter smudgy artifacts.
This is a direct result of undersampling.
To demonstrate, see figures 1.1 through 1.3.
Fig 1.1 - Original (i.e. sampling 0/0) Fig 1.2 - Sampling pattern -4/-4 Fig 1.3 - Result image
This is sampling only every 16x16 pixels (-4), which means for this image that only 256 samples were taken, out of the original's 65536. Note that some of the samples taken lay right on the divide between red and blue. (Fig 1.2)
Due to the undersampling, the result (Fig 1.3) is that blue and a slightly orange red get interpolated together (in RGB space, as evidenced by the darkening. Interpolating in HSV space would provide a different result.)

Normally, You would have an adaptive sampler however... which means that it will sub-sample the undersampling until the difference between samples is low enough, or the maximum sampling density has been reached.
See figures 2.1 through 2.3 for an example of adaptive sampling :
Fig 2.1 - Original (i.e. sampling 0/0) Fig 2.2 - Sampling pattern -4/0 Fig 2.3 - Result image
As You can see, many more samples were taken (12,192), but only where the system deemed them necesssary - i.e. in contrast-rich areas.
This is immediately evidenced by the now sharp line between the red and blue areas. (Fig 2.2)
The result (Fig 2.3) is still pretty sloppy due to the threshold being too high. But even at lower thresholds errors remain there. In GI solutions, however, You generally fail to see such artifacts.
This is where the strength of undersampling comes from... in rendering, it means You have to render less samples = faster rendertimes.
In compression schemes, it means You have to store less bits = smaller filesizes.

Unfortunately, adaptive sampling may sometimes fail in difficult cases.
Compare figures 3.1 and 3.2 :
Fig 3.1
Sampling : 0,0
Speed : 100%
Fig 3.2
Sampling : -4,0
Speed : 536%
As You can see, undersampling sped up the rendering quite a bit.
However, the skylighting in the narrow slots of the wall breaks apart (Fig 3.2). This could likely be fixed with additional image samples (0,0 was used here - no good), but the actual culprit here is the Shade Rate samples.
Changing the Sample Control Rate wouldn't help in these cases either.
Obviously, considering the fact that setting the Shade Rate to 0,0 causes rendertimes to be over five times as long, that's not an option.

So here's what You would do - force the renderer to increase the Shade Rate manually.
Since there's no specific controls for forcing sampling rates for general areas (only on a per-material basis), the renderer has to be 'tricked'.
Ever notice how GI renders with reflecting/refracting surfaces tend to take a bit longer ?
That's because once You start raytracing those surfaces, the renderer drops into pathtracing mode. As a result, the Shade Rate will essentially be 0,0.
The trick is probably dawning upon You now... and here it is, illustrated in the scene used before in Figures 4.1 and 4.2:
Fig 4.1
Red Glass bars
For visualization only
Fig 4.2
Sampling : -4,0/0,0
Speed : 323%
The Red Bars example (Fig 4.1) shows the idea.
A bunch of plane objects (any object without thickness will do) are placed in front of the problem areas.
The material is set to the Brazil Test Mtl, with no ambient, no diffuse, no highlight, 100% transparency, an IOR of 1.0
The plane objects themselves are excluded from skylight shadows, and all shadow receiving/casting in general.
So their only purpose, at this point, is to force those Shade Rate samples to 0,0.

As You can see in the image next to it (Fig 4.2), the result is that the problem areas are now 'perfect', whilst the renderspeed is still kept fairly high when compared to the entirely 0,0 sampled image.
 

Here's all three images next to eachother, for comparison (Figures 5.1 through 5.3) :
Fig 5.1 - undersampled Fig 5.2 - totally singlesampled Fig 5.3 - selectively singlesampled



All trademarks and copyrights on this page are owned by their respective owners.
Everything else: ©2002  SplutterFish, LLC. All Rights Reserved. Privacy