C3DLight::SetSpecular

Top  Previous  Next

Syntax:

 

SetSpecular(float  r, float  g, float  b, float  a)

 

Purpose:

Sets the specular color of the light

 

Parameters:

r, g, b, a - The new specular color.

 

Returned value(s):

None

 

Application:

light1.SetSpecular(1.0, .02, .05)

 

Class Hierarchy

C3DObject

-------C3DLight

 

Additional Info:

After adjusting the light intensity for any attenuation effects, the lighting engine computes how much of the remaining light reflects from a vertex, given the angle of the vertex normal and the direction of the incident light. The lighting engine skips to this step for directional lights because they do not attenuate over distance. The system considers two reflection types, diffuse and specular, and uses a different formula to determine how much light is reflected for each. After calculating the amounts of light reflected, Microsoft Direct3D applies these new values to the diffuse and specular reflectance properties of the current material. The resulting color values are the diffuse and specular components that the rasterizer uses to produce Gouraud shading and specular highlighting.

 

Although Direct3D uses RGBA values for lights, the alpha color component is not used.

 

The default specular color is 0.0, 0.0, 0.0

 

See Also:

SetDiffuse, SetAmbient