As a general rule, use the simplest possible lighting model, a single infinite light with an infinite viewer. For some local effects, try replacing local lights with infinite lights and a local viewer.
You normally won't notice a performance degradation when using one infinite light, unless you use lit textures or color index lighting.
Use the following settings for peak performance lighting:
There may be a sharp drop in lighting performance when switching from one light to two lights, but the drop for additional lights is likely to be more gradual.
Local lights are noticeably more expensive than infinite lights.
Changing material parameters can be expensive. If you need to change the material parameters many times per frame, consider rearranging the scene traversal to minimize material changes. Also consider using glColorMaterial() to change specific parameters automatically, rather than using glMaterial() to change parameters explicitly.
The following code fragment illustrates how to change ambient and diffuse material parameters at every polygon or at every vertex:
glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE);
glEnable(GL_COLOR_MATERIAL);
...
/* Set ambient and diffuse material parameters: */
glColor4f(red, green, blue, alpha);
/* Draw triangles: */
glBegin(GL_TRIANGLES);
...
glEnd();
Setting GL_LIGHT_MODEL_LOCAL_VIEWER to GL_TRUE with glLightModel(), while using infinite lights only, reduces performance by a small amount. However, each additional local light noticeably degrades the transform rate.
Two-sided lighting illuminates both sides of a polygon. This is much faster than the alternative of drawing polygons twice. However, using two-sided lighting is significantly slower than one-sided lighting for a single rendering of an object.
If possible, avoid calls to glMaterial() during a glBegin()/glEnd() drawing sequence, as this has a serious performance impact. While making such calls to change colors by changing material properties is possible, the performance penalty makes it unadvisable. Use glColorMaterial() instead.