D3DLIGHT

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.

dwSize

Size, in bytes, of this structure.

dltType

Type of the light source. This value is one of the members of the D3DLIGHTTYPE enumerated type.

dcvColor

Color of the light. This member is a D3DCOLORVALUE structure.

dvPosition and dvDirection

Position and direction of the light in world space.

dvRange

Distance beyond which the light has no effect.

dvFalloff

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).

dvAttenuation0

Constant light intensity. Specifies a light level that does not decrease between the light and the cutoff point given by the dvRange member.

dvAttenuation1

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.

dvAttenuation2

Light intensity that decreases according to a quadratic attenuation factor.

dvTheta

Angle, in radians, of the spotlight's umbra—that is, the fully illuminated spotlight cone.

dvPhi

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.