GL_FRAGCOORD(3G)
π NAME π
okay so bestie, welcome to the GL_FRAGCOORD(3G) manual page β the header slot is literally marked [FIXME: manual], placeholder energy π. The main character is gl_FragCoord, and it contains the window-relative coordinates of the current fragment. That's the whole name vibe. π
β¨ DECLARATION β¨
Here's the exact declaration, no cap:
in vec4 gl_FragCoord ;
tiny heads-up: the raw page has .SH "DESCRIPTION" stuck right after that semicolon β that's roff formatting noise, bestie, not part of the declaration. The next real section is DESCRIPTION. π
π¦ DESCRIPTION π¦
Available only in the fragment language, gl_FragCoord is an input variable that contains the window relative coordinate (x, y, z, 1/w) values for the fragment. If you're multi-sampling, this value can be for any location within the pixel, or one of the fragment samples. This value is the result of fixed functionality that interpolates primitives after vertex processing to generate fragments. The z component is the depth value that would be used for the fragment's depth if no shader contained any writes to gl_FragDepth().
gl_FragCoord may be redeclared with the additional layout qualifier identifiers origin_upper_left or pixel_center_integer. By default, gl_FragCoord assumes a lower-left origin for window coordinates and assumes pixel centers are located at half-pixel centers. For example, the (x, y) location (0.5, 0.5) is returned for the lower-left-most pixel in a window. The origin of gl_FragCoord may be changed by redeclaring gl_FragCoord with the origin_upper_left identifier. The values returned can also be shifted by half a pixel in both x and y by pixel_center_integer so it appears the pixels are centered at whole number pixel offsets. This moves the (x, y) value returned by gl_FragCoord of (0.5, 0.5) by default to (0.0, 0.0) with pixel_center_integer.
If gl_FragCoord is redeclared in any fragment shader in a program, it must be redeclared in all fragment shaders in that program that have static use of gl_FragCoord. Redeclaring gl_FragCoord with any accepted qualifier affects only gl_FragCoord.x and gl_FragCoord.y. It has no affect (the page's spelling, bestie β no effect) on rasterization, transformation or any other part of the OpenGL pipeline or language features.
π VERSION SUPPORT π
Support vibe check, periodt. The variable name is gl_FragCoord, and under OpenGL Shading Language Version it gets a β in every single one of these versions:
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_FragDepth()β the one other page this manual points you to. Go give it a little wave π
π 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 (part 2, the page really says it twice) π
Copyright Β© 2011-2014 Khronos Group
okay that's the whole page, bestie π«Ά this came from [FIXME: source], dated 08/09/2021, and the manual is GL_FRAGCOORD(3G). slay β¨
π¦ 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