PDA

View Full Version : gl_FragCoord.z question(s)



CelticDaddio
05-30-2006, 12:34 PM
What coord system is gl_FragCoord in? If I read this value in my frag shader, what range of values can I expect? Is it clamped to [0,1]?


CD

canuckle
05-30-2006, 02:46 PM
if I'm not mistaken, gl_FragCoord is in Normalized Device Coordinates (NDC), which in OpenGL means x, y, and z are between -1 and +1.

canuckle
05-30-2006, 02:48 PM
here's a good reference explaining the different coordinate systems:

http://www.cs.queensu.ca/home/jstewart/454/notes/pipeline/