GL_FRONTFACING(3G)
π GL_FRONTFACING π
okay so bestie, this is the GL_FRONTFACING(3G) page β yes, 3G is the manual name, and the header lowkey also says [FIXME: manual], so we're working with what we've got π. It's all about whether a primitive is front or back facing, and it's honestly giving graphics-pipeline main character energy β¨.
β¨ NAME β¨
gl_FrontFacing β indicates whether a primitive is front or back facing. That's the whole vibe of the name, no cap π
.
π DECLARATION π
in bool gl_FrontFacing ;.SH "DESCRIPTION"
bestie, that stray .SH "DESCRIPTION" is literally glued onto the declaration in the source, and I am not editing it, because facts are facts π«Ά.
π DESCRIPTION π
Available only in the fragment language, gl_FrontFacing is an input variable whose value is true if the fragment belongs to a front-facing primitive and false otherwise. slay, that's the whole point π₯.
The determination of whether a triangle primitive is front-facing is made by examining the sign of the area of the triangle, including a possible reversal of this sign as controlled by glFrontFace. One way to compute this area is:
a=12 β j=0 n-1 x w i y w i+1 - x w i+1 y w i
where x w i and y w i are the x and y window coordinates of the ith vertex of the n-vertex polygon. keep that exactly as-is, bestie, character for character π.
The sign of this computation is negated when the value of GL_CLIP_ORIGIN (the clip volume origin, set with glClipControl()) is GL_UPPER_LEFT. so yeah, flip the vibe when the clip origin is upper-left π.
π VERSION SUPPORT π
Variable name: gl_FrontFacing
OpenGL Shading Language Version β gl_FrontFacing is supported with β in every version listed:
1.10β β1.20β β1.30β β1.40β β1.50β β3.30β β4.00β β4.10β β4.20β β4.30β β4.40β β4.50β β
π¦ SEE ALSO π¦
gl_FragCoord()glClipControl()
π COPYRIGHT π
Copyright Β© 2011-2014 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/. periodt π
.
π COPYRIGHT π
Copyright Β© 2011-2014 Khronos Group. yeah bestie, that's the short one, and we're keeping it too π.
signed off with [FIXME: source], dated 08/09/2021, and stamped GL_FRONTFACING(3G) β mwah πβ¨
π¦ 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