D3DLIGHT8
Defines a set of lighting properties.
Type D3DLIGHT8
ambient As D3DCOLORVALUE
diffuse As D3DCOLORVALUE
specular As D3DCOLORVALUE
type As CONST_D3DLIGHTTYPE
Attenuation0 As Single
Attenuation1 As Single
Attenuation2 As Single
Direction As D3DVECTOR
Falloff As Single
Phi As Single
position As D3DVECTOR
Range As Single
Theta As Single
End Type
Members
- ambient
- Ambient color emitted by the light. This member is a D3DCOLORVALUE type.
- diffuse
- Diffuse color emitted by the light. This member is a D3DCOLORVALUE type.
- specular
- Specular color emitted by the light. This member is a D3DCOLORVALUE type.
- type
- Type of the light source. This value is one of the members of the CONST_D3DLIGHTTYPE enumeration.
- Attenuation0, Attenuation1, and Attenuation2
- Values specifying how the light intensity changes over distance. Attenuation values are ignored for directional lights. These members represent attenuation constants. For information on attenuation, see Light Attenuation Over Distance. Valid values for these members range from 0.0 to infinity. For non-directional lights, all three attenuation values should not be set to 0.0 at the same time.
- Direction
- Direction that the light is pointing in world space, specified by a D3DVECTOR type. This member has meaning only for directional and spotlights. This vector need not be normalized, but it should have a nonzero length.
- Falloff
- Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi).
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, specified by a D3DVECTOR type. 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 the square root of FLT_MAX. This member does not affect directional lights.
- Theta
- Angle, in radians, of a spotlight's inner cone—that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.
See Also
Direct3DDevice8.GetLight, Direct3DDevice8.SetLight