Game Development Reference
In-Depth Information
How Lighting Works
Let's think about how lighting works for a moment. The first thing we need is a light source to
emit light. We also need an object that can be lit. Finally, we need a sensor, like our eyes or a
camera, that will catch the photons that are sent out by the light source and reflected back by
the object. Lighting changes the perceived color of an object depending on the following:
The light source's type
ï?®
The light source's color and intensity
ï?®
The light source's position and direction relative to the lit object
ï?®
The object's material and texture
ï?®
The intensity with which light is reflected by an object can depend on various factors. We are
mostly concerned with the angle at which a light ray hits a surface. The more perpendicular
a light ray is to a surface it hits, the greater the intensity of the light reflected by the surface.
Figure 11-1 illustrates this point.
Figure 11-1. The more perpendicular a light ray is to a surface, the greater the intensity of the reflected light
Once a light ray hits a surface, it is reflected in two different ways. Most of the light is reflected
diffusely , which means that the reflected light rays are scattered randomly by irregularities of the
object's surface. Some reflections are specular , which means that the light rays bounce back as
if they had hit a perfect mirror. Figure 11-2 shows the difference between diffuse and specular
reflection.
 
Search WWH ::




Custom Search