I am defining for each vertex of Quad a color. If GL_SMOOTH is enabled the color distribution looks fine, but if i switch to GL_FLAT the color of the QUAD is strange. How does opengl decide, which color of the verteces of the quad is used to display??
The color of the first vertex that builds the primitive will be used to shade the whole primitive.
With smooth shading, the four colors should be interpolated over the quad. With flat shading, the whole quad should be red, cause thats the color of the fist vertex in the quad.
I think it will be yellow in your example, the last color before completion.
Ah, yes, you are right. It’s the last color, not the first, that defines the color of the primitive. Sorry.