RedPhantom opened this issue on Jun 29, 2023 ยท 27 posts
shvrdavid posted Thu, 29 June 2023 at 4:55 PM
Most of the time dot product is used as a conditional vector switch. Think of rain or snow hitting the ground. How do you tell where it hits the ground, where it doesn't, or where it goes afterwards? Well you do it based on the angle it came from and the angle of the surface it landed on, using the dot product of the vectors. Rain falling strait down would come from a vector of 0,0,-1, (assuming z is vertical, +z would be falling up). Any angles would obviously modify x and y. So basically all the dot product does is convert a vector input (x,y,z), into a scalar output (from 0 to 1), so you use it to determine if and when something else happens because of that. In the shader above, it is determining the angle of the incoming light versus the angle of the normals on the object to determine an output. Which is how specular, reflections, etc actually work internally..... That is the simple explanation. You can do far more with it thou....
Some things are easy to explain, other things are not........ <- Store -> <-Freebies->