GL_POSITION(3G)
πΈ NAME πΈ
okay bestie, meet gl_Position β contains the position of the current vertex. This page is GL_POSITION(3G) from the [FIXME: manual] manual, and it's literally the main character of vertex output. π
β¨ DECLARATION β¨
so gl_Position is a member of the gl_PerVertex named block:
out gl_PerVertex {
vec4 gl_Position;
float gl_PointSize;
float gl_ClipDistance[];
};
π¦ DESCRIPTION π¦
In the vertex, tessellation evaluation and geometry languages, a single global instance of the gl_PerVertex named block is available, and its gl_Position member is an output that receives the homogeneous vertex position. It may be written at any time during shader execution. The value written to gl_Position will be used by primitive assembly, clipping, culling and other fixed functionality operations, if present, that operate on primitives after vertex processing has occurred. iconic pipeline behaviour, no cap β¨
In the tessellation control language, the gl_PerVertex named block is used to construct an array, gl_out[], whose gl_Position members hold the homogeneous control point position, which become available as inputs to the subsequent tessellation evaluation shader.
The value of gl_Position (or the gl_Position member of the gl_out[] array, in the case of the tessellation control shader) is undefined after the vertex, tessellation control, and tessellation evaluation shading stages if the corresponding shader executable does not write to gl_Position. It is also undefined after the geometry processing stage if the geometry shader executable calls EmitVertex() without having written gl_Position since the last call to EmitVertex() (or hasn't written it at all). π«Ά
undefined means undefined, bestie β do not roll the dice on that vibe check π
In the tessellation control, tessellation evaluation and geometry languages, the gl_PerVertex named block is used to construct an array, gl_in[] of per-vertex or per-control point inputs whose content represents the corresponding outputs written by the previous stage.
π VERSION SUPPORT π
The table vibes are: function name gl_Position, and the OpenGL Shading Language Version column says it's a β in every single one of these versions:
1.101.201.301.401.503.304.004.104.204.304.404.50
Versions 1.10 to 1.40 - vertex shader only.
Versions 1.50 to 3.30 - vertex and geometry shaders only.
π₯ SEE ALSO π₯
gl_PointSize()gl_ClipDistance()
π 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/.
π COPYRIGHT π
Copyright Β© 2011-2014 Khronos Group
okay bye bestie π this page is from [FIXME: source], dated 08/09/2021 β GL_POSITION(3G), signing off. πβ¨
π¦ 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