In OpenGL vertex shaders, what is w, and why do I divide by it?
W is the fourth coordinate of a three dimensional vertex; This vertex is called homogeneous vertex coordinate. In few words, the W component is a factor which divides the other vector components. When W is 1.0, the homogeneous vertex coordinates are “normalized”. To compare two vertices, you should normalize the W value to 1.0. Think … Read more