CHAPTER 6 RENDERING MODE AND ANTI-ALIASING


In Chapter 5, we explained how to realize transparency effects by mapping transparent textures having alpha values. In concert with this, we also provided a simple explanation of how the Blender blends framebuffer pixels and pipeline pixels. However, the role of the Blender is not simply to produce transparency effects.

In this chapter, we build on our understanding of the Blender by introducing the extremely important topic of anti-aliasing. We also go into more details about the blending process, which was only roughly explained in Chapter 5, and introduce the various rendering modes.

6.1 Overview of Anti-aliasing on the N64

Algorithms for anti-aliasing and theories of implementation are the subjects of widespread research in the graphics field. In general though, much anti-aliasing is based on the process of dividing a pixel up into finer subpixels, determining the color of each, and then averaging these with what is called supersampling.

The problem with this method is that it takes time to calculate the colors of the subpixels, and you also need to reserve memory to store the subpixel colors. The N64 requires rendering processes that are both fast and memory-efficient, so this method has been simplified and a special architecture implemented for anti-aliasing.

For anti-aliasing on the N64, the pipeline color and the framebuffer color are blended based on an amount called the coverage value. The coverage value represents the extent to which a given pixel is covered by a primitive. When this value is small, the background color is heavily emphasized, whereas when this value is large, the pipeline color is more emphasized in the blending.

If you just consider this role of the coverage value, it may seem that the coverage value is very similar to the alpha value. However, it is conceptually important to distinguish between the two. To wit, the coverage value is a number that describes the geometrical concept of the extent to which a pixel is covered by a primitive, whereas the alpha value describes the transparency of the pixel without any other meaning attached. Of course, this is not to say that the two values are unrelated, since the product of the coverage value multiplied by the alpha value can be used for the coverage value and the alpha value inside the Blender.

We will talk more of the coverage value in the next section. Here we will give a simple presentation of how anti-aliasing is performed on the N64. You can think of anti-aliasing as a two-stage process on the N64:

1.Anti-aliasing with the Blender (see Figure 6-1)
  In this stage, aliased interior edges of polygons are eliminated. An interior edge is an edge that is shared by two polygons.


Figure 6-1 The data flow in anti-aliasing (Stage 1)

2.Anti-aliasing with the Video Interface (VI) (see Figure 6-2)
  In this second stage, the silhouette edges of the polygon are anti-aliased. Silhouette edges are all exterior edges of the rasterized polygon. This anti-aliasing process is executed at the stage when data is sent from the framebuffer to the DAC.


Figure 6-2 The data flow in anti-aliasing (Stage 2)


Figure 6-3 Interior edge and silhouette edges

In the following sections, we will provide detailed explanations of how coverage values are calculated and about blending in the Blender.