Game Development Reference
In-Depth Information
10.7
Light Sources
In the rendering equation, light sources produce their effect when we factor
in the emissive component of a surface. As mentioned earlier, in real-time
graphics, doing this “properly” with emissive surfaces is usually a luxury
we cannot afford. Even in o ine situations where it can be afforded, we
might have reasons to just emit light out of nowhere, to make it easier to
get control of the look of the scene for dramatic lighting, or to simulate the
light that would be reflecting from a surface for which we're not wasting
time to model geometry since it's off camera. Thus we usually have light
sources that are abstract entities within the rendering framework with no
surface geometry to call their own. This section discusses some of the most
common types of light sources.
Section 10.7.1 covers the classic point, directional, and spot lights. Sec-
tion 10.7.2 considers how light attenuates in the real world and how devi-
ations from this reality are common for practical reasons. The next two
sections move away from the theoretically pure territory and into the messy
domain of ad-hoc lighting techniques in use in real-time graphics today. Sec-
tion 10.7.3 presents the subject of Doom-style volumetric lights. Finally,
Section 10.7.4 discusses how lighting calculations can be done o ine and
then used at runtime, especially for the purpose of incorporating indirect
lighting effects.
10.7.1
Standard Abstract Light Types
This section lists some of the most basic light types that are supported
by most rendering systems, even older or limited platforms, such as the
OpenGL and DirectX fixed-function lighting pipelines or the Nintendo Wii.
Of course, systems with programmable shaders often use these light types,
too. Even when completely different methods, such as spherical harmonics,
are used at runtime, standard light types are usually used as an o ine
editing interface.
A point light source represents light that emanates from a single point
outward in all directions. Point lights are also called omni lights
(short for “omnidirectional”) or spherical lights. A point light has a
position and color, which controls not only the hue of the light, but also its
intensity.
Figure 10.30 shows how 3DS Max represents point lights
visually.
As Figure 10.30 illustrates, a point light may have a falloff radius, which
controls the size of the sphere that is illuminated by the light. The intensity
of the light usually decreases the farther away we are from the center of
the light. Although not realistic, it is desirable for many reasons that the
intensity drop to zero at the falloff distance, so that the volume of the
 
Search WWH ::




Custom Search