next up previous contents index
Next: 2.13.6 Clamping or Masking Up: 2.13 Colors and Coloring Previous: 2.13.4 Lighting State

2.13.5 Color Index Lighting

 

A simplified lighting computation applies in color index mode that uses many of the parameters controlling RGBA lighting, but none of the RGBA material parameters. First, the RGBA diffuse and specular intensities of light i ( and , respectively) determine color index diffuse and specular light intensities, and from

and

indicates the R component of the color and similarly for and .

Next, let

where and are given by equations 2.4 and 2.5, respectively, and and are given by equations 2.2 and 2.3, respectively. Let . Finally, let

Then color index lighting produces a value c, given by

The final color index is

The values , and are material properties described in Tables 2.7 and 2.8. Any ambient light intensities are incorporated into . As with RGBA lighting, disabled lights cause the corresponding terms from the summations to be omitted. The interpretation of and the calculation of front and back colors is carried out as has already been described for RGBA lighting.

The values , , and are set with Material  using prop of COLOR_INDEXES. Their initial values are 0, 1, and 1, respectively. The additional state consists of three floating-point values. These values have no effect on RGBA lighting.



David Blythe
Sat Mar 29 02:23:21 PST 1997