https://www.shadertoy.com/view/XffGW4

void mainImage( out vec4 O, vec2 U )
{
   vec2 V = mod(U, 100.);
   O = vec4( V.x == 0.5);
   // O = vec4( V.x == 0.6);
}

this is the result: enter image description here

change 0.5 to 0.6 the vertical line disapears, why?

enter image description here

V.x range from -0.5 to 0.5 or 0 to 100?

I have try change the 0.5 but did not work.

1

There are 1 best solutions below

1
On

U (which is actually fragCoord(gl_FragCoord)) is the current fragment position center, so it's .5 for the left most pixel, 1.5 for the fragment next to it etc. so the range of V.x will be .5 - 99.5 in increments of 1..