2012-08-02 07:52:30 by Homer in Daily Zombie
I knew that I could pass World and View transforms to the (current) shader as a Dual Quaternion (ie two vec4's), but I thought that I would be stuck with passing the Projection transform as a traditional 4x4 matrix.
Today I learned that it is indeed possible for me to pass a Projection transform as a homogenous vec4.
This is a ground breaking development - I can ELIMINATE ALL MATRICES AND THEIR MATH both on the cpu and the gpu !!!
I always secretly hoped this was so, but only today was I convinced.
I offer the following quote:
"Perspective should not be used as a regular object transform. It's performed in separate stage when we need to project the world on the camera/light. This transformation also uses homogeneous vector representation, while other transformations don't. Therefore, it's a right decision to move the perspective out of spatial transform capabilities. In order to produce it we just need to pass the tan(fov/2) value to the shader and apply it manually for W component computation of gl_Position variable."