typedef struct _D3DLIGHT {
DWORD dwSize;
D3DLIGHTTYPE dltType;
D3DCOLORVALUE dcvColor;
D3DVECTOR dvPosition;
D3DVECTOR dvDirection;
D3DVALUE dvRange;
D3DVALUE dvFalloff;
D3DVALUE dvAttenuation0;
D3DVALUE dvAttenuation1;
D3DVALUE dvAttenuation2;
D3DVALUE dvTheta;
D3DVALUE dvPhi;
} D3DLIGHT, *LPD3DLIGHT;
Defines the light type in calls to methods such as IDirect3DLight::SetLight and IDirect3DLight::GetLight.
Size, in bytes, of this structure.
Type of the light source. This value is one of the members of the D3DLIGHTTYPE enumerated type.
Color of the light. This member is a D3DCOLORVALUE structure.
Position and direction of the light in world space.
Distance beyond which the light has no effect.
Decrease in illumination between the umbra (the angle specified by the dvTheta member) and the outer edge of the penumbra (the angle specified by the dvPhi member).
Constant light intensity. Specifies a light level that does not decrease between the light and the cutoff point given by the dvRange member.
Light intensity that decreases linearly. The light intensity is 50 percent of this value halfway between the light and the cutoff point given by the dvRange member.
Light intensity that decreases according to a quadratic attenuation factor.
Angle, in radians, of the spotlight's umbra—that is, the fully illuminated spotlight cone.
Angle, in radians, defining the outer edge of the spotlight's penumbra. Points outside this cone are not lit by the spotlight.
The system uses all three of the attenuation settings to determine how the effect of a light decreases with distance from the source. The following equation shows how the attentuation settings are interpreted. The value d here is the distance between the vertex being lit and the light:
For more information about lights, see Lighting Module.