gl_FragCoord.xy origin?

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[ ?

It is in window coordinates not viewport coordinates so the range will be mapped from [0,0] to [windowWidth-1, windowHeight-1]

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.