Shader Learn

01 Fragments and data

mix: between two values

Push the amount from 0 to 1 and watch the colours between the two ends.

01
ExerciseTune values0%

Stop the colour at 80% mint

Runs once per pixelDrag numbers, or edit the code

mix(a, b, t) = a×(1−t) + b×t. t = 0 gives a, t = 1 gives b.

Try it

  • Set t to 0.5: exactly halfway
  • In the code, change t to vUv.x to get a gradient