This brief guide discusses light attenuation in Rhino.
So you are interested in taking advantage
ON_Light::Attenuation in your render plugin, and you need to clarify how you can use it. Is the input vector supposed to represent the distance over which you want the light to attenuate to zero?
Light attenuation determines how fast the light intensity decreases with distance from objects.
The three coefficients to light attenuation are:
- Constant attenuation ()
- Linear attenuation ()
- Quadratic attenuation ()
Thus, you could create the input vector as follows:
ON_3dVector attenuation( C, L, Q );
NOTE: Rhino’s user interface only uses constant attenuation so that adding a light reveals everything, no matter how far away the light source is from any given piece of geometry.
Types of Attenuation
If you want constant attenuation, or:
then both and must be and (usually ).
If you want linear attenuation:
where = distance to light, then and vary and must be .
If you want quadratic attenuation:
then all 3 coefficients can and should vary.