Shader Learn

05 Data becomes vertices

Vertices: really changing the geometry

This time we move the mesh’s actual vertices.

00.55
110

Runs once per vertexDrag numbers, or edit the code

JS sidegl.uniform1f(uTime, 0.00) gl.uniformMatrix4fv(uModel, …) // rotation -0.35 / -0.80

The vertex shader really moves the mesh’s vertices; a fragment shader can only change colour, never shape.

Try it

  • Set the height to 0: the surface goes flat again
  • In the vertex code, change sin to abs(sin(...))