Back to index

Fragment Shader Art

Exercises

  1. uv holds the screen-space coordinates adjusted for the aspect ratio. Visualize this by setting the color to the euclidian distance to the origin. Use length(). You can save the distance in the float called d.
  2. Having just one color can be a bit boring, so let's use a palette. Send the calculated distance to the palette() function and use the return value as color.
  3. Now let's transform d to be something more that just the euclidian distance. Make sure to do the transformations after calculating the palette color.
  4. Let's add some latitudal and longitudal dependencies as well. Introduce two new variables:
  5. Play around with the values and introduce new effects!

Inputs

Uniforms


Render window

Fragment shader