Calculating Reflection Vector
 |
where L and N are unit length
=> projection of L on N is N cos [theta]
S = N cos [theta] - L |
R is L mirrored about N
R = N cos [theta] + S = 2N cos [theta] - L
= 2N (N.L) - L => where Ispec = ks Il ( (2N (N.L) - L ).V )n
(2N (N.L) - L ).V = R.V = cos [phi]
Alternatively: use halfway vector H
H = (L + V) / |L + V| = { direction of maximum highlights }
maximum highlight when H = N (because then R = V)
=> Ispec = ks Il (H.N)n
H.N = cos [alpha]
Two methods:
- can give different results ( [alpha] != [theta] )
- H is faster to compute when viewer and light at infinity (constant H)
|