Next: 2.3.2 Lighting in the Up: 2.3 Lighting Previous: 2.3 Lighting

2.3.1 Types of Lighting

The effects of light are complex. In OpenGL, lighting is divided into four different components: emitted, ambient, diffuse, and specular. All four components can be computed independently and then added together.

Emitted light is the simplest. It is light that originates from an object and is unaffected by any light sources. Self-luminous objects can be modeled using emitted light.

Ambient light is light from some source that has been scattered so much by the environment that its direction is impossible to determine. Even a directed light such as a flashlight may have some ambient light associated with it.

Diffuse light comes from some direction. The brightness of the light bouncing off an object depends on the light's angle of incidence with the surface it is striking. Once it hits a surface, the light is scattered equally in all directions so it appears equally bright independent of where the eye is located.

Specular light comes from some direction and tends to bounce off the surface in a certain direction. Shiny metal or plastic objects have a high specular component. Chalk or carpet have almost none. Specularity corresponds to the everyday notion of how shiny an object is.

A single OpenGL light source has a single color and some combination of ambient, diffuse, and specular components. OpenGL supports multiple lights simultaneously. The programmer can control the makeup of a light as well as its position, direction, and attenuation. Attenuation refers to how a light's intensity decreases as distance from the light increases.


mjk@asd.sgi.com
Wed Oct 19 18:11:46 PDT 1994