Dynamically configure and enable the appropriate light sources before rendering each lit object. For example, in the hallway of candles, only the candles nearest a particular object should affect the object significantly because candles are dim. The technique can also improve overall lighting performance by disabling light sources with insignificant contributions to an object's coloration. The remainder of this article describes the last approach in more detail including the presentation of screen snapshots and sample source code to demonstrate the technique. First, a few words about OpenGL's lighting model.
Light is a complicated phenomenon.
If you want to implement effects such as reflections and shadows with OpenGL, you can with more sophisticated rendering techniques beyond those supported by OpenGL's lighting model. What OpenGL does model is per-vertex interactions involving only the surface material and a set of light sources. In practice, this is enough to achieve some pretty nice effects at interactive rates. In practice, you can think of OpenGL's lighting model as really a bunch of equations that compute an RGB color value at each vertex. Indeed, if you want to really understand OpenGL's lighting model, see the explanation of OpenGL's lighting operation in the OpenGL 1.1 specification .