'\" te '\"macro stdmacro .ds Vn Version 1.2 .ds Dt 24 September 1999 .ds Re Release 1.2.1 .ds Dp May 22 14:46 .ds Dm 6 May 22 14: .ds Xs 04246 5 .TH GLSHADEMODEL 3G .SH NAME .B "glShadeModel \- select flat or smooth shading .SH C SPECIFICATION void \f3glShadeModel\fP( GLenum \fImode\fP ) .nf .fi .SH PARAMETERS .TP \w'\f2mode\fP\ \ 'u \f2mode\fP Specifies a symbolic value representing a shading technique. Accepted values are \%\f3GL_FLAT\fP and \%\f3GL_SMOOTH\fP. The initial value is \%\f3GL_SMOOTH\fP. .SH DESCRIPTION GL primitives can have either flat or smooth shading. Smooth shading, the default, causes the computed colors of vertices to be interpolated as the primitive is rasterized, typically assigning different colors to each resulting pixel fragment. Flat shading selects the computed color of just one vertex and assigns it to all the pixel fragments generated by rasterizing a single primitive. In either case, the computed color of a vertex is the result of lighting if lighting is enabled, or it is the current color at the time the vertex was specified if lighting is disabled. .P Flat and smooth shading are indistinguishable for points. Starting when \%\f3glBegin\fP is issued and counting vertices and primitives from 1, the GL gives each flat-shaded line segment i the computed color of vertex i + 1, its second vertex. Counting similarly from 1, the GL gives each flat-shaded polygon the computed color of the vertex listed in the following table. This is the last vertex to specify the polygon in all cases except single polygons, where the first vertex specifies the flat-shaded color. .Bd -literal Primitive Type of Polygon i Vertex Single polygon ( i == 1) 1 Triangle strip i + 2 Triangle fan i + 2 Independent triangle 3i Quad strip 2i + 2 Independent quad 4i .Ed Flat and smooth shading are specified by \%\f3glShadeModel\fP with \f2mode\fP set to \%\f3GL_FLAT\fP and \%\f3GL_SMOOTH\fP, respectively. .SH ERRORS \%\f3GL_INVALID_ENUM\fP is generated if \f2mode\fP is any value other than \%\f3GL_FLAT\fP or \%\f3GL_SMOOTH\fP. .P \%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glShadeModel\fP is executed between the execution of \%\f3glBegin\fP and the corresponding execution of \%\f3glEnd\fP. .SH ASSOCIATED GETS \%\f3glGet\fP with argument \%\f3GL_SHADE_MODEL\fP .SH SEE ALSO \%\f3glBegin\fP, \%\f3glColor\fP, \%\f3glLight\fP, \%\f3glLightModel\fP