Game Development Reference
In-Depth Information
“global,” because often one global ambient value is used for the entire scene.
However, some techniques, such as lighting probes, attempt to provide more
localized and direction-dependent indirect lighting.
Sometimes a ray of light travels directly from the light source to the eye,
without striking any surface in between. The standard lighting equation
accounts for such rays by assigning a material an emissive color. For exam-
ple, when we render the surface of a light bulb, this surface will probably
appear very bright, even if there are no other light sources in the scene,
because the light bulb is emitting light.
In many situations, the emissive contribution doesn't depend on envi-
ronmental factors; it is simply the emissive color of the material:
The emissive
contribution depends
only on the material
c emis = m emis .
Most surfaces don't emit light, so their emissive component is 0 . Surfaces
that have a nonzero emissive component are called “self-illuminated.”
It's important to understand that in real-time graphics, a self-
illuminated surface does not light the other surfaces—you need a light
source for that. In other words, we don't actually render light sources,
we only render the effects that those light sources have on the surfaces in
the scene. We do render self-illuminated surfaces, but those surfaces don't
interact with the other surfaces in the scene. When using the rendering
equation properly, however, emissive surfaces do light up their surround-
ings.
We may choose to attenuate the emissive contribution due to atmo-
spheric conditions, such as fog, and of course there may be performance
reasons to have objects fade out and disappear in the distance. However,
as explained in Section 10.7.2, in general the emissive contribution should
not be attenuated due to distance in the same way that light sources are.
10.6.5 The Lighting Equation: Putting It All Together
We have discussed the individual components of the lighting equation in
detail. Now it's time to give the complete equation for the standard lighting
model.
m spec ) max ( n h ,0) m gls
c spec
+ c diff
+ c amb
+ c emis
( s spec
The standard lighting
equation for one light
source
+ ( s diff
m diff ) max ( n l ,0)
c lit
=
=
m amb
+ m emis
Figure 10.26 shows what the ambient, diffuse, and specular lighting
components actually look like in isolation from the others. (We are ignoring
the emissive component, assuming that this particular floating head doesn't
emit light.) There are several interesting points to be noted:
+ g amb
Search WWH ::




Custom Search