IDirect3DRMLight::SetConstantAttenuation
Sets the constant attenuation factor for a light.
HRESULT SetConstantAttenuation(
D3DVALUE rvAtt
);
Parameters
rvAtt
New constant attenuation factor.
Return Values
Returns D3DRM_OK if successful, or an error otherwise. For a list of possible return codes, see Direct3D Retained-Mode Return Values.
Remarks
Lights that have a location (are not infinitely far away) can have attenuation factors to calculate the attenuation of the light based on distance from the light.
The formula for the total attenuation factor is:
1 / [constant_attenuation_factor + distance * linear_attenuation_factor + (distance**2) * quadratic_attenuation_factor]
The total attenuation factor cannot be greater than 1. When attenuation factors are not provided, the default values are 1.0 for the constant attenuation factor, 0.0 for the linear attenuation factor, and 0.0 for the quadratic attenuation factor.
This method is also used to add a constant attenuation key to a Direct3DRMLightInterpolator object.
See Also