Contents / Previous / Next


Shading Model

[IMAGE] A line or a filled polygon primitive can be drawn with a single color (flat shading)
or with many different colors (smooth shading, also called Gouraud shading).

You specify the desired shading technique with:

void glShadeModel (GLenum mode);

The mode parameter can be either GL_SMOOTH (the default) or GL_FLAT.

With flat shading, the color of one vertex of a primitive is duplicated across all the primitive's vertices.

With smooth shading, the color at each vertex is treated individually. For a line primitive, the colors along the line segment are interpolated between the vertex colors. For a polygon primitive, the colors for the interior of the polygon are interpolated between the vertex colors.