Game Development Reference
In-Depth Information
N
H
L
V
α
α
Q
Figure 7.5. The angle between the normal vector N and the halfway vector H can also be
used to determine specular intensity.
Adding the contributions from n light sources, we can express the specular
component of our lighting formula as
n
NH
m
{
}
(
)
=

max
, 0
NL
>
0
,
(7.8)
specular
i
i
i
i
=
1
where
H is the halfway vector for the i -th light source given by
LV
+
i
H
=
LV .
(7.9)
i
+
i
7.5 Texture Mapping
One or more texture maps may be applied to a surface to achieve greater detail,
as shown in Figure 7.6. At each point on a surface, a texel (texture pixel) is
looked up in each texture map and combined in some way with the lighting for-
mula. In the simplest case, a sample from a diffuse texture map is looked up and
used to modulate the diffuse reflection color. More advanced applications are
discussed later in this chapter.
Search Nedrilad ::




Custom Search