So gl_FragCoord.xy
goes from 0 to screen/window width
and height
.
And uniform vec2 uResolution
passes stationary window width and height.
Assuming the window is full screen on my 1920 * 1080 display,
vec2 uv = gl_FragCoord.xy / uResolution.xy;
gl_FragColor = vec4( uv, .0, 1.0);
should result in a normalized uv coordinate system with bottom left being 0, 0
(i.e. 0/1920, 0/1080) and top right being 1, 1
(i.e. 1920/1920, 1080/1080)
But why does the top range on both axis get severely overshot and shrinks the 0-1 range in the bottom left like the first image?
Because applying a simple fract to this uv, uv = fract( uv );
, gives the divisions, as in the 2nd image, like if I multiplied uv by 5.
: