Graphics Reference
In-Depth Information
However, Eq. (10.1) defines intensity, rather than color. The nature of the human eye allows
us to describe color in terms of three additive components: red, green blue, which gives rise to
three color intensities:
V n
I r =
k ar I ar +
I ir k dr n
·
L
+
k sr R
·
I ig k dg n
V n
I g =
k ag I ag +
·
L
+
k sg R
·
V n
I b =
k ab I ab +
I ib k db n
·
L
+
k sb R
·
(The extra suffices, r, g, and b, identify the red, green, and blue components, respectively.)
Having independent terms for each color component enables colored light sources to illuminate
different colored surfaces.
Although Eq. (10.1) is correct, it does reference the reflected light vector R , which is currently
undefined. However, Eq. (5.6) describes how a vector is reflected away from a line or plane:
2 n
n
·
v in
v out =
v in
2
n
where
v in is the incident vector,
v out is the reflected vector,
n is the normal vector.
If n is a unit vector, this simplifies to
v out =
v in
2 n
·
v in n
(10.2)
If Eq. (10.2) is to be used in Eq. (10.1) we have to reverse v in so that it points towards the light
source:
v out =
2 n
·
v in n
v in
and if we substitute the vector names associated with our lighting model, we obtain
R
=
2 n
·
L n
L
(10.3)
Blinn [Blinn, 1977] proposed a way of avoiding calculating R altogether. This involved defining
a vector h half-way between L and V :
L
+
V
h
=
(10.4)
L
+
V
And as h is viewer-dependent, n
·
h can replace R
·
V in Eq. (10.1):
h n
I
=
k a I a +
I i k d n
·
L
+
k s n
·
(10.5)
In fact, Eq. (10.5) is employed in OpenGL and DirectX.
 
Search WWH ::




Custom Search