Attenuation

OpenGL attenuation uses a formula with 3 adjustable coefficients, so that you can vary light realistically, or semi-realistically:

                         1
brightness = -----------------------
              Kc + Kl * d + Kq * d^2

These coefficients are controlled by the following calls:

glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, Kc);
glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, Kl);
glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, Kq);