Skip to main content
1 of 2
snake5
  • 3.6k
  • 1
  • 17
  • 28

Of course you should normalize it - it isn't the Lambert term if it isn't normalized.

dot(N,L) = max(cos(angle between direction to light and surface normal),0)

And (in HLSL-ish pseudocode): dot(A,B) = cos(angle(A,B)) * length(A) * length(B)

So to get dot(A,B) = cos(angle(A,B)), length of both vectors must be equal to 1 (which is what normalization does - divides a vector by its length).

https://en.wikipedia.org/wiki/Lambert's_cosine_law

snake5
  • 3.6k
  • 1
  • 17
  • 28