Brain Dump

Attenuation

Tags
computer-graphics

Reducing the intensity of a point-light as the distance from it increases.

A common formula for this is defined as: \( F_{att}=\frac{1.0}{K_c + K_t * d + K_q * d^2} \)

We define \( d \) as the distance between the light source and fragment.

The remaining three variables are parameters configuring how attenuation should work:

  • \( k_c \) - a constant, often just one to make sure the denominator is > 1.
  • \( k_t \) - a linear term which causes light intensity to decrease linearly.
  • \( k_q \) - a quadratic term which becomes much more impactful as distance increases. For low distances this isn't all that meaningful.

Links to this note