View Full Version : gl_FragCoord.xy origin ?

07-06-2011, 04:16 AM
Hi all !
A very dumb question about gl_FragCoord but I can't find the information anywhere.

GLSL Specification says gl_FragCoord.xy holds window coordinates for each fragment, but does not precise if it is relative to viewport or not.

For example, if I set my viewport to (10,10,100,100), what would be the range of gl_FragCoord.xy ? [0..100[ or [10..110[ ?

07-06-2011, 04:37 AM
It is in window coordinates not viewport coordinates so the range will be mapped from [0,0] to [windowWidth-1, windowHeight-1]