Practical Implementations of Anti-aliasing

Although several hardware and software implementations of anti-aliasing have been developed, they have not been successful in the mainstream consumer market to date. High CPU processing overhead, memory bandwidth constraints, and memory costs have made implementing anti-aliasing capability impractical for the consumer market. Even the less demanding "edge "antialiasing (which attempts to address the jagged edges artifacts, but not improving the polygon popping artifacts) has not been successful due to its relatively poor quality and negative performance impact. Anti-aliasing until very recently has remained exclusive to the high-end CAD-CAM and off-line rendering markets.

With the recent generation of CPUs and graphics processors, however, consumer systems finally have the processing power, memory bandwidth, and memory capacity to make anti-aliasing practical. This article explains the basic types of super-sample anti-aliasing and examines two specific implementations.

Super-Sampling Techniques

As explained earlier, aliasing is a result of sampling, or more specifically, the lack of a sufficient sampling rate. Super-sampling, as the name suggests, solves the aliasing problem by taking more samples than would normally be the case. By taking more samples, we are able to more accurately capture the visual quality of the infinitely detailed natural world. So the first essential element of super-sampling is that extra samples are used to increase the density of image information. You can see this as taking sub-samples at the pixel level. Thus, instead of one single central sample per-pixel, super-sampling techniques utilize several samples per pixel. It is the location of these sub-samples within a pixel that defines two different types of super-sampling anti-aliasing.

Ordered Grid Super-Sampling is the first and most common type of super-sampling anti-aliasing. The name "Ordered Grid" is descriptive of the sub-sample positions within a given pixel. The extra samples are positioned in an ordered grid shape. The sub-samples are aligned horizontally and vertically, creating a matrix of points. These sub-samples are thus located inside the original pixel in a regular pattern as shown in Figure 3a.


Click for a bigger version

The second type of super-sampling anti-aliasing is known as Jittered Grid Super-Sampling (JGSS). JGSS is similar to Ordered Grid Super-Sampling in that extra samples are stored per pixel, but the difference between the two is the position of the sub-samples. With OGSS, the sub-sample grid is parallel and aligned to the horizontal and vertical axis. However with JGSS, the sub-sample grid is "jittered," or shifted, off of the axis. An example of a sub-sample pattern used with JGSS is shown in Figure 3b.There are a variety of different ways of "jittering "the sub-sample positions, and we will now investigate the two most common implementations.

The first implementation, Fully Random Jittered Super-Sampling,is better known as Stochastic Sampling. Essentially this means that within a pixel, the sub-samples are positioned in random locations. The key here is that the sub-sample pattern is random for every pixel on screen. The basic idea behind this technique is that the randomized locations of the sub-samples is actually seen as "white noise "by the human eye. This technique hides the aliasing effect in noise, which is based on the known fact that the human eye is less sensitive to random noise than regular patterns. Our eyes are very good at recognizing patterns, but the introduction of random noise makes the recognition of patterns - in this case aliasing artifacts - significantly more difficult. While the quality of this technique is excellent, it is very expensive to implement. Approximately 16 (or more) randomly distributed sub-samples per-pixel are needed to attain the necessary level of white noise. Lower sample counts also work, but these are more susceptible to artifacts. Fully random positions also tend to be difficult to generate. Improvements in this technique exist to avoid accidental patterns, or samples being taken too closely to each other. One example is the use of a Poisson Distribution of sample points [5], but these techniques are extremely complex and not yet available in consumer level hardware.

A second implementation of sample positions of JGSS is a simplified form of the first. Instead of using completely random patterns, a predefined pattern that approximates the effect of random sampling is re-used for every pixel of the screen. So we again get a grid (as in a repeating pattern), but the repeated pattern is more random and less uniform. Again, various random patterns exist. A pattern suggested by the OpenGL documentation is a "shear" transformed grid [2]. The ordered grid is thus shifted sideways. This shift removes some of the regularities that exist in the OGSS pattern. However, this pattern removes only the vertical regularity. The horizontal regularity is maintained, so the column structure of OGSS is destroyed but the row-like structure remains. Also, quite often used is a rotated ordered grid. We'll call this technique Rotated Grid Super-Sampling, or RGSS for short. With RGSS, the sub-sample locations are the same as those used in OGSS, but they are rotated by a certain angle. The sub-sample positions for an RGSS implementation are illustrated in Figure 3b. Note that both the horizontal and vertical regularities are destroyed, so there are no definite columns or rows.

With the theory and definitions of OGSS and RGSS behind us, we will now focus on practical implementations using today's hardware for both techniques. We examine one hardware implementation for each super-sampling technique, but keep in mind that there are numerous ways for implementing the super-sampling anti-aliasing techniques described.