transpose
A core linear algebra node that computes the transpose of an input matrix (swapping its rows and columns). It is crucial for advanced graphics calculations like correct normal transformation and efficient rotation inversion.
Core Advantages
By providing the built-in GLSL transpose function, it solves two key problems: 1. It ensures the correctness of normal transformations under non-uniform scaling, enabling physically accurate lighting. 2. It offers a computationally inexpensive method for inverting pure rotation matrices, significantly boosting shader performance.
Common Uses
Calculating the inverse-transpose matrix to correctly transform normal vectors
Used as a low-cost inverse for rotation matrices
Performing basis changes between different coordinate systems
How to adjust
This is a pure mathematical function whose effect depends on the input matrix. Input a rotation matrix, and the output will be its inverse rotation. Input a shear matrix, and the output will be a new shear matrix with different geometric properties. It has no tunable parameters itself; its role is to alter the algebraic properties of the input transformation.
Code Examples
1// Efficiently get the inverse of a rotation-only matrix (like viewMatrix).
2// This is much faster than calculating a full matrix inverse.
3const inverseRotationMatrix = transpose( viewMatrix );