GLPOLYGONSTIPPLE(3G)
π NAME π
glPolygonStipple β bestie, this one sets the polygon stippling pattern β¨
π C SPECIFICATION π
void glPolygonStipple( const GLubyte *mask )
πΈ PARAMETERS πΈ
maskβ a pointer to a 32Γ32 stipple pattern, and it gets unpacked out of memory exactly the same wayglDrawPixelsunpacks pixels. no cap.
π¦ DESCRIPTION π¦
Okay so. Polygon stippling is literally the polygon version of line stippling (peep glLineStipple for that one π
). What it does is mask out certain fragments that rasterization produces, so you get a pattern instead of a solid fill. And the way it works is independent of polygon antialiasing β they don't talk to each other, periodt.
So mask is a pointer to a 32Γ32 stipple pattern, and it sits in memory just like the pixel data you'd hand to a glDrawPixels call where height and width are both equal to 32, the pixel is GL_COLOR_INDEX, and the data type is GL_BITMAP. Basically: the stipple pattern is a 32Γ32 array of 1-bit color indices, packed into unsigned bytes. π«Ά
And the glPixelStore parameters β things like GL_UNPACK_SWAP_BYTES and GL_UNPACK_LSB_FIRST β those absolutely affect how the bits get assembled into a stipple pattern. But listen: pixel transfer operations (shift, offset, pixel map) are NOT applied to the stipple image. nope. not happening. π
To turn polygon stippling on and off, you call glEnable and glDisable with the argument GL_POLYGON_STIPPLE. Out of the gate, polygon stippling is initially disabled. Now if it is enabled, here's the vibe check: a rasterized polygon fragment with window coordinates xw and yw gets sent to the next stage of the GL if and only if the (xw mod 32)th bit in the (yw mod 32)th row of the stipple pattern is 1 (one). And when polygon stippling is disabled? It's as if the stipple pattern is all 1's. iconic behavior honestly. π
π ERRORS π
GL_INVALID_OPERATIONis generated ifglPolygonStippleis executed between the execution ofglBeginand the corresponding execution ofglEnd. like, do not do that. π«
π₯ ASSOCIATED GETS π₯
glGetPolygonStippleglIsEnabledwith argumentGL_POLYGON_STIPPLE
β SEE ALSO β
glDrawPixels(3G), glLineStipple(3G), glPixelStore(3G), glPixelTransfer(3G)
okay that's the whole page, bestie π this came straight out of the GLPOLYGONSTIPPLE(3G) manual page, 3G energy and all β so if you ever forget the pattern bits, you know exactly where to find your girl. mwah. π
β¨π
π¦ where this page comes from
- opensuse-leap 16.0: Mesa-libGL-devel 24.1.7-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms