OpenGL fragment shader inputs
From GPWiki
A OpenGL Shading Language (GLSL) fragment shader does not receive inputs through its main function. Instead, it gets input through predefined variables that it can access as though they were global variables
Special Output Variables
These variables are read and writeable.
- vec4 gl_FragColor - The resultant fragment color.
- vec4 gl_FragColor[gl_MaxDrawBuffers] - The resultant fragment data.
- float gl_FragDepth - The fragment depth.
Special Input Variables
These variables are read only.
- vec4 gl_FragCoord - Pixel coordinates.
- bool gl_FrontFacing - True if the pixel is facing the front.
Varying Outputs
These variables will have been interpolated. These variables are read only.
- vec4 gl_Color - The color of the fragment. Created by interpolation of gl_FrontColor and gl_BackColor.
- vec4 gl_SecondaryColor - The secondary color of the fragment.
- vec4 gl_TexCoord[] - An array with maximum size = gl_MaxTextureCoords.
- float gl_FogFragCoord - The fog fragment coordinate.