GLSTENCILMASKSEPARAT(3G)
β¨ GLSTENCILMASKSEPARAT(3G) β stencil mask, but make it separate β¨
okay bestie, welcome to the 3G manual page for glStencilMaskSeparate, and honestly? she's a little niche but she is SO worth knowing π
πΈ NAME πΈ
glStencilMaskSeparate β control the front and/or back writing of individual bits in the stencil planes π
like, which bits in the stencil planes are even allowed to be written, and for which faces. that's her whole job. periodt.
π¦ C SPECIFICATION π¦
void glStencilMaskSeparate(GLenum face, GLuint mask);
two args, no drama β¨
π PARAMETERS π
faceβ tells us whether the front stencil writemask, the back stencil writemask, or both get updated. only three symbolic constants are valid here, and they are literallyGL_FRONT,GL_BACK, andGL_FRONT_AND_BACK. no cap.maskβ a bit mask that enables and disables writing of individual bits in the stencil planes π₯ initially, the mask is all 1's. iconic default behavior.
π§ DESCRIPTION π§
so glStencilMaskSeparate controls the writing of individual bits in the stencil planes. the least significant n bits of mask β where n is the number of bits in the stencil buffer β specify a mask. where a 1 shows up in the mask, it's possible to write to the corresponding bit in the stencil buffer β¨ where a 0 shows up, that corresponding bit is write-protected π« initially, all bits are enabled for writing.
and here's the fun part: there can be two separate mask writemasks β one affects back-facing polygons, and the other affects front-facing polygons as well as other non-polygon primitives π«Ά
glStencilMask() sets both front and back stencil writemasks to the same values, as if glStencilMaskSeparate() were called with face set to GL_FRONT_AND_BACK. so likeβ¦ the non-separate version is just this one doing both at once, iykyk π
π ERRORS π
GL_INVALID_ENUMis generated iffaceis not one of the accepted tokens. so like, don't be cute and invent a new one π
β ASSOCIATED GETS β
glGet() with argument GL_STENCIL_WRITEMASK, GL_STENCIL_BACK_WRITEMASK, or GL_STENCIL_BITS π
π VERSION SUPPORT π
the original page ships this as a big table with the columns Function / Feature Name down the side and OpenGL Version across the top, and the row for glStencilMaskSeparate has a β in, like, every single one. so bestie: it's supported in 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, and 4.5 π₯ all of them. every last one. ate and left no crumbs π
π SEE ALSO π
glColorMask()glDepthMask()glStencilFunc()glStencilFuncSeparate()glStencilMask()glStencilOp()glStencilOpSeparate()
go read those too, they're all in the same friend group π«Ά
π COPYRIGHT π
Copyright Β© 2006 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.
Copyright Β© 1991-2006 Silicon Graphics, Inc.
and that's the whole page, bestie πΈ this came from [FIXME: source], dated 08/09/2021, and yes the header up top said GLSTENCILMASKSEPARAT(3G) β go forth and mask your stencil bits separately, you absolute main character πβ¨π
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms