1

In Phong lighting model a vector R is used to calculate the spectral component of light. The equation used to obtain it is

R = 2(N•L)N - L

I can't understand why we use this equation. Could someone give me a demonstration of how we obtain this equation?

Fabrizio Duroni
  • 277
  • 2
  • 14
  • For anybody arriving here from a search, I have a more detailed explanation of the derivation of the formula in question - without requiring prior knowledge of vector algebra - on the math sister site: https://math.stackexchange.com/a/4335556/6928 – Theraot Dec 21 '21 at 16:51

1 Answers1

2

The equation is a consequence of the symmetry of the reflection of the light about the normal:

enter image description here

We know from the law of reflection that the angle between R and N is the same as the one between L and N. Therefore it's also clear that:

R•N = L•N (assume all are unit vectors)

From symmetry, it's also evident that

R - (R•N)N = - (L - (L•N)N)

Now we can replace (R•N)N with (L•N)N from the previous equation. So we have:

R - (L•N)N = - (L - (L•N)N)

Adding (L•N)N to both sides gives:

R = - (L - (L•N)N) + (L•N)N
  = - L + (L•N)N + (L•N)N
  = 2(L•N)N - L
Ryan
  • 965
  • 1
  • 7
  • 12