Skip to main content

I'm new to shaders and nowknow that you can color pixelpixels with gl_FragColor but sometimes there is this thing:

vec2 uv = gl_FragCoord.xy / screenSize; // or resolution or smthn depends on the implementation

ifIf gl_FragCoord is like pixel coordinates, what does uv get?

Why I it'sis it often done in GLSL?

If someone could even draw an example of which part of the screen is will be UV it will be very helpful!

I'm new to shaders and now that you can color pixel with gl_FragColor but sometimes there is this thing

vec2 uv = gl_FragCoord.xy / screenSize; // or resolution or smthn depends on the implementation

if gl_FragCoord is like pixel coordinates, what does uv get?

Why I it's often done in GLSL?

If someone could even draw an example which part of screen is will be UV it will be very helpful!

I'm new to shaders and know that you can color pixels with gl_FragColor but sometimes there is this thing:

vec2 uv = gl_FragCoord.xy / screenSize; // or resolution or smthn depends on the implementation

If gl_FragCoord is like pixel coordinates, what does uv get?

Why is it often done in GLSL?

If someone could even draw an example of which part of the screen will be UV it will be very helpful!

Source Link
idchlife
  • 373
  • 1
  • 3
  • 6

GLSL. Can someone explain why gl_FragCoord.xy / screenSize is performed and for what reason?

I'm new to shaders and now that you can color pixel with gl_FragColor but sometimes there is this thing

vec2 uv = gl_FragCoord.xy / screenSize; // or resolution or smthn depends on the implementation

if gl_FragCoord is like pixel coordinates, what does uv get?

Why I it's often done in GLSL?

If someone could even draw an example which part of screen is will be UV it will be very helpful!