next up previous contents index
Next: 3.5.3 Antialiasing Up: 3.5 Polygons Previous: 3.5.1 Basic Polygon Rasterization

3.5.2 Stippling


Polygon stippling works much the same way as line stippling, masking out certain fragments produced by rasterization so that they are not sent to the next stage of the GL. This is the case regardless of the state of polygon antialiasing. Stippling is controlled with

void PolygonStipple ( ubyte *pattern ) ;

*pattern is a pointer to memory into which a pattern is packed. The pattern is unpacked from memory according to the procedure given in section 3.6.3 for DrawPixels ; it is as if the height and width passed to that command were both equal to 32, the type were BITMAP, and the format were COLOR_INDEX. The unpacked values (before any conversion or arithmetic would have been performed) are bitwise ANDed with 1 to obtain a stipple pattern of zeros and ones.

If and are the window coordinates of a rasterized polygon fragment, then that fragment is sent to the next stage of the GL if and only if the bit of the pattern is 1.

Polygon stippling may be enabled or disabled with Enable  or Disable  using the constant POLYGON_STIPPLE. When disabled, it is as if the stipple pattern were all ones.

David Blythe
Sat Mar 29 02:23:21 PST 1997