Platform SDK: DirectX

D3DLIGHT7

The D3DLIGHT7 type defines the light type in calls to methods such as Direct3DDevice7.SetLight and Direct3DDevice7.GetLight.

Type D3DLIGHT7
    ambient As D3DCOLORVALUE
    attenuation0 As Single
    attenuation1 As Single
    attenuation2 As Single
    diffuse As D3DCOLORVALUE
    direction As D3DVECTOR
    dltType As CONST_D3DLIGHTTYPE
    falloff As Single
    phi As Single
    position As D3DVECTOR
    range As Single
    specular As D3DCOLORVALUE
    theta As Single
End Type

Members

ambient
Ambient color emitted by the light. This member is a D3DCOLORVALUE type.
attenuation0, attenuation1, and attenuation2
Values specifying how a light's intensity changes over distance. (Attenuation does not affect directional lights.) For information about how these attenuation values affect lighting in a scene, see Light Attenuation Over Distance. Valid values for these members range from 0.0 to infinity, inclusive.
diffuse
Diffuse color emitted by the light. This member is a D3DCOLORVALUE type.
direction
Direction the light is pointing in world space. This member only has meaning for directional and spotlights. This vector need not be normalized but it should have a nonzero length.
dltType
Type of the light source. This value is one of the following members of the CONST_D3DLIGHTTYPE enumeration.
falloff
Decrease in illumination between a spotlight's inner cone (the angle specified by the theta member) and the outer edge of the outer cone (the angle specified by the phi member). For details on how falloff values affect a spotlight, see Spotlight Falloff Model.

The effect of falloff on the lighting is subtle. Furthermore, a small performance penalty is incurred by shaping the falloff curve. For these reasons, most developers set this value to 1.0.

phi
Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.
position
Position of the light in world space. This member has no meaning for directional lights and is ignored in that case.
range
Distance beyond which the light has no effect. The maximum allowable value for this member is D3DLIGHT_RANGE_MAX, which is defined as the square root of FLT_MAX. This member does not affect directional lights.
specular
Specular color emitted by the light. This member is a D3DCOLORVALUE type.
theta
Angle, in radians, of the spotlight's inner cone — that is, the fully illuminated spotlight cone. This value must be between 0 and the value specified by the phi member.

Remarks

For more information about lights, see Lights.