Random

rand() hash functions psuedo-random


Stack Overflow: What’s the origin of this GLSL rand() one-liner?

Rand()


Checkerboard 3


Scattered Dots


Autopainter


In-class Challenge

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

Modify the Rand() Example

  1. Make the static change every frame.
  2. Make the static black and red.

Modify the Checkerboard 3 Example

  1. Make the checkerboard random shades of gray instead of full color.
  2. Make all the squares in a column the same random color.

Modify the Scattered Dots Example

  1. Make the dots random sizes.
  2. Make the dots random colors.

Modify the Autopainter Example

  1. Make the background a gradient.
  2. Add a second circle.

Challenging Challenges

Make these!

Checkerboard Challenge Dots Challenge