Contents
- Dependencies
- Overview
- New Procedures and Functions
- New Tokens
- Errors
Dependencies
None
Overview
This extension adds a second color to rasterization when lighting is enabled. Its purpose is to produce textured objects with specular highlights which are the color of the lights. It applies only to rgba lighting.
The two colors are computed at the vertexes. They are both clamped, flat-shaded, clipped, and converted to fixed-point just like the current rgba color (see Figure 2.8). Rasterization interpolates both colors to fragments. If texture is enabled, the first (or primary) color is the input to the texture environment; the fragment color is the sum of the second color and the color resulting from texture application. If texture is not enabled, the fragment color is the sum of the two colors.
A new control to LightModel, LIGHT_MODEL_COLOR_CONTROL_EXT, manages the values of the two colors. It takes values: SINGLE_COLOR_EXT, a compatibility mode, and SEPARATE_SPECULAR_COLOR_EXT, the object of this extension. In single color mode, the primary color is the current final color and the secondary color is 0.0. In separate specular mode, the primary color is the sum of the ambient, diffuse, and emissive terms of final color and the secondary color is the specular term.
There is much concern that this extension may not be compatible with the future direction of OpenGL with regards to better lighting and shading models. Until those impacts are resolved, serious consideration should be given before adding to the interface specified herein (for example, allowing the user to specify a second input color).
New Procedures and Functions
None.
New Tokens
Accepted by the
<pname>
parameter of LightModel, and also by the
<pname>
parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev:
|LIGHT_MODEL_COLOR_CONTROL_EXT | 0x81F8| |:---------------------------------|:------|
Accepted by the
<param>
parameter of LightModel when
<pname>
is LIGHT_MODEL_COLOR_CONTROL_EXT:
|SINGLE_COLOR_EXT | 0x81F9| |:-------------------|:------| |SEPARATE_SPECULAR_COLOR_EXT | 0x81FA|
Errors
None.