|
|
|
|
| |
Radeon® Alpha Testing
|
Alpha testing is used to do pixel rejection based on the alpha value of a pixel in much the same way that z testing can be used to do pixel rejection based on a pixel's z value. Unlike stencil or depth/z buffer-based pixel rejection, however, the alpha value of the pixel is compared against an API-level reference value, not a value already present in the frame buffer.
As shown in the OpenGL® sample RAGE 128AlphaTest and the Direct3D® sample RAGE 128AlphaTest, alpha testing can be used to do pixel rejection of alpha blended sprites so that writes to the z-buffer do not occur in areas of the sprite that are completely masked out (alpha is zero). The sample application shows how an alpha blended primitive can cause unwanted Z-buffer writes. Figure 1 shows a quad drawn behind an animated texture sequence. Although the alpha blending applied to the texture prevents writes to the color buffer, z-buffer writes still occur causing the blue quad's depth test to fail several times even though the color buffer was untouched by the explosion in those areas.
| |
| |
|
| |
 |
|
|
|