Back to index
Indexed Draw and Vertex Attributes
Exercises
Change the index list to draw a triangle between vertices 3, 4 and 5.
Keep the green triangle and add back the original red triangle.
Can you control which triangle that ends up on top?
Try changing the color of the vertices by changing the vertex attributes.
What happens when attributes within a triangle have different values?
Vertices / Indices
Vertices:
// x, y, z, r, g, b
Indices:
Vertex shader
Fragment shader
Render window
Compile log
Compile