The routine grAlphaControlsITRGBLighting() can be used to specify that if the high order bit of atexture is 1, then the constant color set by grConstantColorValue() is used instead of the iterated RGB values. This is useful if a portion of a texture is to appear to be illuminated from behind the surface, instead of by an external light source.
void grAlphaControlsITRGBLighting( FxBool enable )
When enabled, the normal color combine controls for local color (clocal) are overridden, and the most significant bit of texture alpha (atexture) selects between iterated vertex RGB and the constant color set by grConstantColorValue(). By default, this alpha controlled lighting mode is disabled. Table Color and Lighting.4 shows how clocal is determined.
Table Color and Lighting.4 Overriding the local color when the high order bit of atexture is set.
You can get hybrid effect between smooth and flat shading by using grAlphaControlsITRGBLighting() to enable a technique whereby the high order bit of atexture is used to switch clocal between iterated RGB and the constant color. The state table below shows how the clocal value is determined.
When enable is
|
and the high order bit of atexture is
|
the local color clocal will be
|
FXTRUE
|
0
|
iterated RGB
|
FXTRUE
|
1
|
|
Share with your friends: |