C3DLight::SetDiffuse

Top  Previous  Next

Syntax:

 

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

 

Purpose:

Sets the diffuse color of the light.

 

Parameters:

r, g, b, a - Then new diffuse color

 

Returned value(s):

None

 

Application:

light1.SetDiffuse(1.0, .5, .5)

 

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 diffuse color is 1.0, 1.0, 1.0

 

See Also:

SetAmbient, SetSpecular