glSecondaryColor

set the current secondary color

Signature

glSecondaryColor( )->
glSecondaryColor3b( GLbyte ( red ) , GLbyte ( green ) , GLbyte ( blue ) )-> void
glSecondaryColor3b( red , )
glSecondaryColor3bv( const GLbyte * ( v ) )-> void
glSecondaryColor3bv( )
glSecondaryColor3d( GLdouble ( red ) , GLdouble ( green ) , GLdouble ( blue ) )-> void
glSecondaryColor3d( red , )
glSecondaryColor3dv( const GLdouble * ( v ) )-> void
glSecondaryColor3dv( )
glSecondaryColor3f( GLfloat ( red ) , GLfloat ( green ) , GLfloat ( blue ) )-> void
glSecondaryColor3f( red , )
glSecondaryColor3fv( const GLfloat * ( v ) )-> void
glSecondaryColor3fv( )
glSecondaryColor3i( GLint ( red ) , GLint ( green ) , GLint ( blue ) )-> void
glSecondaryColor3i( red , )
glSecondaryColor3iv( const GLint * ( v ) )-> void
glSecondaryColor3iv( )
glSecondaryColor3s( GLshort ( red ) , GLshort ( green ) , GLshort ( blue ) )-> void
glSecondaryColor3s( red , )
glSecondaryColor3sv( const GLshort * ( v ) )-> void
glSecondaryColor3sv( )
glSecondaryColor3ub( GLubyte ( red ) , GLubyte ( green ) , GLubyte ( blue ) )-> void
glSecondaryColor3ub( red , )
glSecondaryColor3ubv( const GLubyte * ( v ) )-> void
glSecondaryColor3ubv( )
glSecondaryColor3ui( GLuint ( red ) , GLuint ( green ) , GLuint ( blue ) )-> void
glSecondaryColor3ui( red , )
glSecondaryColor3uiv( const GLuint * ( v ) )-> void
glSecondaryColor3uiv( )
glSecondaryColor3us( GLushort ( red ) , GLushort ( green ) , GLushort ( blue ) )-> void
glSecondaryColor3us( red , )
glSecondaryColor3usv( const GLushort * ( v ) )-> void
glSecondaryColor3usv( )

Parameters

VariablesDescription
red, green, blue
Specify new red, green, and blue values for the current secondary color.

Parameters

v
Specifies a pointer to an array that contains red, green, blue.

Description

The GL stores both a primary four-valued RGBA color and a secondary four-valued RGBA color (where alpha is always set to 0.0) that is associated with every vertex.
The secondary color is interpolated and applied to each fragment during rasterization when GL_COLOR_SUM is enabled. When lighting is enabled, and GL_SEPARATE_SPECULAR_COLOR is specified, the value of the secondary color is assigned the value computed from the specular term of the lighting computation. Both the primary and secondary current colors are applied to each fragment, regardless of the state of GL_COLOR_SUM , under such conditions. When GL_SEPARATE_SPECULAR_COLOR is specified, the value returned from querying the current secondary color is undefined.
glSecondaryColor3b , glSecondaryColor3s , and glSecondaryColor3i take three signed byte, short, or long integers as arguments. When v is appended to the name, the color commands can take a pointer to an array of such values.
Color values are stored in floating-point format, with unspecified mantissa and exponent sizes. Unsigned integer color components, when specified, are linearly mapped to floating-point values such that the largest representable value maps to 1.0 (full intensity), and 0 maps to 0.0 (zero intensity). Signed integer color components, when specified, are linearly mapped to floating-point values such that the most positive representable value maps to 1.0, and the most negative representable value maps to $-1.0$ . (Note that this mapping does not convert 0 precisely to 0.0). Floating-point values are mapped directly.
Neither floating-point nor signed integer values are clamped to the range $\left[0,1\right]$ before the current color is updated. However, color components are clamped to this range before they are interpolated or written into a color buffer.

Notes

glSecondaryColor is available only if the GL version is 1.4 or greater.
The initial value for the secondary color is (0, 0, 0, 0).
The secondary color can be updated at any time. In particular, glSecondaryColor can be called between a call to glBegin and the corresponding call to glEnd .

Associated Gets

glGet with argument GL_CURRENT_SECONDARY_COLOR
glGet with argument GL_RGBA_MODE
glIsEnabled with argument GL_COLOR_SUM