You can run any of the examples locally with Python's SimpleHTTPServer:
cd step-0
python -m SimpleHTTPServer
Then open localhost:8000 in your browser. Or just follow along online with the p5.js editor.
Note that this tutorial uses WEBGL2 and will only work on browsers that support WEBGL 2. In practice, this means you need to use Firefox or Chrome. Safari will not work!
- Understand how to configure p5js for WebGL 2
- Understand the jobs of the vertex and fragment shaders
- Configure a simple sketch with shaders
- Understand how to animate attributes
- Attributes are properties such as position, color, alpha, scale, rotation
- Distinguishing geometry with gl_VertexID
- For each vertex, we want to know which square the vertex belongs to
- If we want to specify per-square attributes (position, color, scale), then all vertices belonging to the same square should share the same attributes
- If each square has 6 vertices, then we can calculate a unique id for each square as
int square_id = floor(gl_VertexID / 6)
- Random number generation
- Use the square id as a seed, then hash the value
- Drawing outlined circles in each square
- Specifying user interaction through uniforms
- Noise functions
- Correct aspect ratios