Back to index

Indexed Draw and Vertex Attributes

Exercises

  1. Change the index list to draw a triangle between vertices 3, 4 and 5.
  2. Keep the green triangle and add back the original red triangle.
  3. Try changing the color of the vertices by changing the vertex attributes.

Vertices / Indices

Vertices:

Indices:

Vertex shader

Fragment shader