4 ms·
The APIs (D3D, etc.) do use matrices, and that's all that matters from the point of view of an engine developer. Composing quats together is certainly faster th
by dahart 7y ago
The APIs (D3D, etc.) do use matrices, and that's all that matters from the point of view of an engine developer. Composing quats together is certainly faster than composing matrices, but quats are limited (no translation / skew / perspectivce / etc.), so there is no direct apples-to-apples comparison between quats and mats.
- earenndil 7y agoThey let you upload matrix data to the gpu, but all functions like glUniformMatrix4fv() really do is upload a 16-vector into gpu memory (and optionally reshuffle its layout). The shading languages also have matrix primitives, that's just sugar.
- Const-me 7y ago> The APIs (D3D, etc.) do use matrices D3D API exposes a way to pass constant buffers to shaders. You can pass whatever you want there, even integers. There're couple limitations, size must be multiple of 16 bytes, and can't exceed 64kb, but I don't remember anything specific to matrices. Now, the only place I can remember which specifically targets matrices - mul intrinsic in HLSL. But that thing is just a syntactic sugar, usually compiling into dp4 dxbc instructions.