Lighting Model
The OpenGL lighting model distinguishes between four types of light,
one of which is internal:
The remaining three light types are external:
- Ambient
- Diffuse
- Intensity dependent on the angle between the light source and the
surface normal.
- Specular
- Intensity dependent on the angle between the light source, the
surface normal, and the viewing direction.
and between the characteristics of the light source and the
material properties of the objects being illuminated.
The color at a vertex is computed as follows:

where
-
is the emissive RGB value of the current material
-
is the ambient RGB value of the lighting model,
i.e. it is not associated with a specific light source
- n is the number of light sources
-
is the light source constant attenuation coefficient
-
is the light source linear attenuation coefficient
-
is the light source quadratic attenuation coefficient
- d is the distance from the vertex to the light source
-
is the ambient RGB value of the light source
-
is the ambient RGB value of the material
-
is the unit vector from the vertex to the light source
-
is the surface normal vector
-
is the diffuse RGB value of the light source
-
is the diffuse RGB value of the material
-
is the sum
and the vector from the vertex and
the viewpoint
- Sh is the specular exponent of the material
-
is the specular RGB value of the light source
-
is the specular RGB value of the material
On to the OpenGL lighting functions...
Back to shading...
Back to the 13.016 overview...