摘要 |
A method and apparatus for generating a mask (126) identifying a number of subsamples (sub0, sub1, sub2, sub3) of a pixel (73) that are covered by a primitive (74) includes the process of apportioning an image, comprising a plurality of scan lines into a plurality of sub-scan lines (sub-scanline0, sub-scanline3, sub-scanline5, sub-scanline7), such that a number of sub-scan lines crosses each pixel (73). A sample point (sub0, sub1, sub2, sub3) 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 (52) is used to step along each edge (edge1, edge2, edge3) of the primitive (74), generating a sub-scan line coordinate for the edge. The edge stepping hardware (52) 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 (89) 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 (126) 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 (126) representing covered subsamples is provided by using incremental techniques to approximate a percentage of pixel coverage without the complex hardware and lookup tables used in the prior art. |