Light Attenuation

This brief guide discusses light attenuation in Rhino.

Problem

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?

Solution

Light attenuation determines how fast the light intensity decreases with distance from objects.

The three coefficients to light attenuation are:

  1. Constant attenuation ()
  2. Linear attenuation ()
  3. 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

Constant

If you want constant attenuation, or:

then both and must be and (usually ).

Linear

If you want linear attenuation:

where = distance to light, then and vary and must be .

Quadratic

If you want quadratic attenuation:

then all 3 coefficients can and should vary.