Spotlights

Normally, local light sources shine equally in all directions.
Using spotlight options, you can have a light shine in a particular direction.

A spotlight's beam is a cone starting from the light position and pointing in the spotlight direction (GL_SPOT_DIRECTION).

The angle of the cone is defined by the GL_SPOT_CUTOFF value.

GL_SPOT_EXPONENT makes the brightness of the spotlight fall off toward the edges.


glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, direction)
glLightf(GL_LIGHT0, GL_SPOT_CUTOFF, angle)
glLightf(GL_LIGHT0, GL_SPOT_EXPONENT, exponent)