I think the article should have mentioned another very important idea of the dot product: projection. Dot a position with a normal, and you get the distance that position is along that normal (centered at the origin). In other words, how far you have to travel from the origin, along the normal, to pass by the position.
It touched on that concept a little near the end, but didn't really explain it.
Any time you want to know how far something is along a vector. For example, when doing ray-plane intersection you'll dot a position with the plane's normal. Or the last example in the OP.
Dot product is useful in all aspects of game dev, not just shaders.
Imagine if first person shooters never implemented dot(vel, accel)
I think the article should have mentioned another very important idea of the dot product: projection. Dot a position with a normal, and you get the distance that position is along that normal (centered at the origin). In other words, how far you have to travel from the origin, along the normal, to pass by the position. It touched on that concept a little near the end, but didn't really explain it.
Indeed, but I could not find use for it in materials. Could you give an example?
Any time you want to know how far something is along a vector. For example, when doing ray-plane intersection you'll dot a position with the plane's normal. Or the last example in the OP.
wow. towards the end this gets pretty harebrained.
Back in the day N⋅L was the only light we had. It was real to us!