Imagine the following scene:
Reducing the size of each circle to 1px gives a predictable result. The resulting image has alternating green and red vertical lines:
2 Different sampling methods
Depending on the sampling method used the lines may not have a uniform color. The same scene rendered with jittered sampling results in:
The end result however is still an image with vertical lines containing either shades of green or shades of red i.e. a vertical green line contains no shades of red and vice versa.
3 Aliasing artifacts
When the size of the circles varies slightly from the sampling frequency, aliasing artifacts occur. E.g. sampling 1.05px circles uniformly (1 sample/px):
This shows a clear pattern that does not exist in the scene. Although usually more subtle, this demonstrates clearly why most rendering methods use various anti-aliasing techniques to avoid this.
Jittered sampling is quite effective at eliminating most forms of aliasing. Although it looks better, for this case the end result is not acceptable:
When sampling circles of 1px the sampling occurs in in lockstep:
Although different sampling techniques might sample these individual pixels differently, there is only either green or red in each pixel.
When the circle is slightly larger than the pixel size (1.05px) the sampling no longer occurs in lockstep:
With uniform sampling at 1 sample/px this results in the black symmetric spots in Figure 4. The regular pattern of the scene results in the multiple areas where only the background is sampled. In figure 7 happens in the bottom right pixels.
The core issue with this pattern is that every sampled pixel will contain a varying amount of red and green. From left to right the pixels will contain:
- only green (+ background)
- mostly green, little bit of red (+ background)
- equal amounts green and red (+ background)
- mostly red, little bit of green (+ background)
- only red (+ background)
The jittered sampling in Figure 5 gets rid of the symmetric black spots but still has some aliasing artifacts. There are multiple vertical bands of noise. These noisy bands occur when the pixels are being sampled as described in steps 2, 3 and 4.
More advanced jittered sampling patterns like e.g. multi-jittered sampling won't do any better:
The core issue remains the same, namely that going left to right pixels contain a varying amount of red and green.
Avoiding these vertical noise bands is not straight-forward. An ideal solution would necessarily have to result in uniform noise. There is simply not enough available resolution to do better. Therefore it is best to avoid this situation all together by either:
- increasing the image resolution
- changing the world-to-image scaling factor (pixel size)
- modifying the scene
Interestingly, the classic anti-aliasing checkerboard example side-steps this problem 1:
The same bands appear, but because the square size decreases rapidly as the distance from the camera increases they are not noticeable.