Light | Dark

gl_FragCoord

Name

gl_FragCoord — contains the window-relative coordinates of the current fragment

Declaration

in highp vec4 gl_FragCoord ;

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 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.

Version Support

OpenGL ES Shading Language Version
Variable Name 1.00 3.00 3.10
gl_FragCoord

See Also

gl_FragDepth

Think you can improve this page? Edit this page on GitHub.