Basics + Built-ins

precision main gl_FragColor step mod floor vec2 vec3 vec4 distance sin domain warping swizzling

Stripes


Checkerboard


Rings


Triangle Wave


Dots


Waves


In-class Challenge

Explore the code examples above by completing the following challenges in order.
Don’t skip any.

Modify the Stripes example

  1. Make the stripes horizontal.
  2. Make wide white stripes with small black spaces.

Modify the Checkerboard example

  1. Make the checkers smaller
  2. Make the checkers wide
  3. Find the mod call and change the second parameter to 4.0. This will create diagonal “stripes”, kinda. Make the stripes go the other way.

Modify the Rings example

  1. Make them wider.
  2. Move the center of the rings.

Modify the Triangle example

  1. Make the triangles bigger.
  2. Make them ramp the other way.

Modify the Dots example

  1. Make the dots bigger.
  2. Make the dots closer.

Modify the Waves example

  1. Increase the frequency of the waves.
  2. Increase the amplitude of the waves.

Challenging Challenges

Make these!

Dot Gradient Wave Wave Wave Check