Fragment Level AA Explained
When rendering a scene while using fragment level anti-aliasing (such as that used by Matrox Parhelia-512) one basically performs all operations normally. The scene is rendered and all is well. The variation occurs in that an additional stage is added to the pixel pipeline. This stage uses a coverage mask on each pixel, with each section of the mask being a fragment. When laid over an edge pixel, it is determined as to whether or not each fragment falls within the triangle in question. If the fragment is found inside the triangle, it is assigned a value of one, where if the fragment is outside of the edge, the assign value is zero.
A coverage mask in action
With the fragment level data having been determined for a pixel, this data is carried along the pipeline as the pixel is rendered. When the pixel is completed, it is written as a normal pixel, without any anti-aliasing. The fragment data is written to a fragment buffer and stored for later use.
Filtering must take place after completion of the scene and this is where the fragment data comes into play. With numerous filter types existing, the exact method used is entirely up to the engineers designing the system. Any filter shape can be used, such as a box, X, or crossed shape, or even the ever popular quincunx pattern.
The filtering process takes place by making note of what percentage of the pixel is within the triangle and what percentage is outside of it. The side(s) of the pixel that are in and out of the triangle must be considered as well to properly filter.
With the filtering information available, the pixel in question is blended with neighboring pixels. While technically blurring, and thus not ideal, one might consider this a “smart blur” in that it only does so along edges so as not to distort the image and blurs at a calculated level with the pixels that are calculated to be used for such. We will discuss the level of quality actually delivered later in this article.
There are a variety of ways to implement a fragment level anti-aliasing algorithm. For example, Matrox has their proprietary implementation (which they simply coin FAA), as well as Bitboys with their MatrixAA. Other implementations exist, though none have seen the light of day in hardware. With that said though, we will discuss a couple of implementations so as to better understand how the different algorithms function.