3 ms·
Shader languages do not include quaternions as primitives, so if you do have quaternions in your GPU shaders, it's your own code (or a library), not NVidia's. W
by krajzeg 7y ago
Shader languages do not include quaternions as primitives, so if you do have quaternions in your GPU shaders, it's your own code (or a library), not NVidia's. What is usually done in shaders is encoding all transformations (rotation, scale, translation) in 4x4 matrices, which are a primitive in all shader languages I know of.
From my personal experience, it can pay off immensely to understand the internal structure of the representation you're working with. I can look at a 4x4 matrix and immediately identify some stuff (does it include a translation component? does it scale and is this scale uniform? is it rotated and around which axis?).
Meanwhile, I can't do this with a quaternion. I know what they do and can understand how, but I have no intuition for what the four numbers mean.