< OpenGL Programming
Vertex shader
Input variables
Output variables
vec4 gl_Position
: vertex homogeneous coordinates in projection spacefloat gl_PointSize
: using rendering points, size of the point
Fragment shader
Input variables
vec4 gl_FragCoord
: pixel coordinates (x,y) + fragment depth (z)bool gl_FrontFacing
: is pixel facing the camera or the opposite direction? (used in two-sided lighting)vec2 gl_PointCoord
: when using Point Sprites, position within the point
Output variables
vec4 gl_FragColor
: RGBA color to usevec4 gl_FragData[gl_MaxDrawBuffers]
: alternative to gl_FragColor when drawing to multiple buffers
References
- "OpenGL ES Shading Language 1.0.17 Specification". Khronos.org. 2009-05-12. http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf. Retrieved 2011-09-25.
- Comment on this page
Browse & download complete code ![](../../I/Download.svg.png.webp)
![](../../I/Download.svg.png.webp)
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.