摘要 |
A method and apparatus for generating a mask identifying a number of subpixels that are covered by a primitive includes the process of apportioning an image, comprising a plurality of scan lines into a plurality of sub-scan lines, such that a number of sub-scan lines crosses each pixel. A sample point is placed on at least one of the sub-scan lines. To determine the number of samples that are covered by a primitive, edge stepping is used to step along each edge of the primitive, generating a sub-scan line coordinate for the edge. The edge stepping hardware is used for stepping either on a sub-scan line granularity, for operation in anti-aliased mode, or on a scan line granularity, for operation in aliased mode. In anti-aliased mode, as each edge sub-scan line coordinate is generated, it is compared against the coordinates of a sample point on that sub-scan line, to determine whether or not that sample point is covered by the primitive. A mask is generated for each pixel, with each bit of the mask corresponding to one of the sub-scan line samples. A bit in the mask is set if the subsample is covered by the primitive. Thus, a mask representing covered subsamples is provided by using incremental techniques to approximate pixel coverage without the complex hardware and lookup tables used in the prior art. |