Back to index

In/Out Variables and Provoking Vertex

Exercises

  1. Replace the red color in the fragment shader with the varying in variable var_color.
  2. Add a second triangle with indices 2, 1, 3.
  3. Put the keyword flat in front of the var_color variable in the vertex and fragment shaders. However, do not put it in front of the out variable in the fragment shader!

Vertices / Indices

Vertices:

Indices:

Vertex shader

Fragment shader