Why normalize it?

Started by
11 comments, last by Mussi 11 years, 8 months ago
So the final advice is to normalize every vector that I use in dot product no matter what?
Advertisement
I'm sorry to say, but you will need to learn at least the basics of linear algebra to understand what's going on there in the pixel shader. On the other hand it's not that complicated.
I'd say if you're confident in programming you will grasp the math pretty easily.

So the final advice is to normalize every vector that I use in dot product no matter what?

No, there are plenty of cases where you don't want to normalize a vector used in a dot product. It depends on what you're trying to do. In this case you're interested in the angle between the vectors, the dot product of two normalized vectors gives you the cosine of that angle. So in this case, you want both vectors to be normalized.

This topic is closed to new replies.

Advertisement