Shader Learn

01 Fragments and data

UV: an address on the surface

X becomes red, Y becomes green. Move the pointer to read the coordinate.

UV0.50, 0.50
01
01

Runs once per pixelDrag numbers, or edit the code

UV is a surface coordinate; on this plane bottom left is (0,0) and top right (1,1), unlike screen pixels.

Try it

  • Set the U weight to 0: the red gradient disappears
  • Change 0.25 to 1.0 and blue fills everything