Definition of MAX_VERTEX_UNIFORM_VECTORS with respect to Mat4s?

According to the OpenGLES spec all implementations are guaranteed to support at least 128 elements in a uniform vector array:

How does that translate to Mat4’s? Is a Mat4 considered a kind of vector (like a 16-dimensional vector) or should you divide 128 by four to get the max number of elements in a Mat4 uniform array?

You should divide the limit by four.

Okay, 32 is no good. You need 128 matrices to do GPU skinning.

Can you explain why? I don’t believe you need that many matrices for GPU skinning, but depends on how you plan to do it.
On the other hand, you can also use quaternions. That way you just don’t reduce your uniform footprint by 50% but you also avoid interpolation issues otherwise present when using matrices.
Also, with matrices you don’t need to have an actual 4x4 matrix for skinning, 3x4 is perfectly fine as you want only rotation and translation but no projection.
Finally, if vertex texture fetch is supported by your target hardware (I think most mobile GPUs do support it) then you can store your matrices in textures too.

Yep. This works well if you limit your joint influences to at most 2 per vertex, and insist that they be adjacent joints.

If you need 3+ joint influences/vertex and/or non-adjacent joint influences, use Dual Quaternions (DQ) – only adds a single float over Quat/Trans. In these cases with Quat/Trans, you have to solve for a “compromise” rot center for each influence permutation and use more complex skinning. DQs avoid all that and look better.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.