If you are dealing with generic lighting units, the intensity of point lights and spot lights can be set to stay uniform or diminish over distance. Enable attenuation on your point or spot light, to make objects farther away from the light source look darker. Attenuation is also referred to as decay.
There are two types of attenuation:
You can also specify the distances at which light attenuation starts and ends. This determines where the light starts and ends as a distance from the center of the light. These limits are not supported by the viewport, and only affect the images returned by the mental ray renderer.
The following code shows how to set a point or spot light to use inverse linear attenuation with start and end limits:
AcGiLightAttenuation lightAttenuation; lightAttenuation.setAttenuationType(AcGiLightAttenuation::kInverseLinear); lightAttenuation.setUseLimits(true); lightAttenuation.setLimits(10.0,50.0); AcDbLight pointOrSpot; pointOrSpot.setAttenuation(lightAttenuation); // Rest of the light set up calls...