glTF Vertex Weight Constraints for Skeletal Meshes
Preparing skeletal meshes for the glTF 2.0 format requires adhering to strict vertex weight and joint influence rules to ensure broad compatibility across real-time 3D engines. This guide outlines the core vertex weight constraints in glTF, including the four-influence baseline limit, attribute set scaling, data type specifications, and weight normalization standards.
Maximum Influences per Vertex Attribute Set
In glTF 2.0, skinning data is stored in paired vertex attribute
arrays: JOINTS_n and WEIGHTS_n.
- The 4-Joint Baseline: Each attribute set must be a
4-component vector (
VEC4). Therefore, a single skinning set (JOINTS_0andWEIGHTS_0) supports a maximum of 4 bone influences per vertex. - Expanding Influences: If a vertex requires more
than 4 influences, additional sets must be added sequentially
(
JOINTS_1,WEIGHTS_1, etc.). Two sets allow up to 8 influences, three allow up to 12, and so forth. - Engine Support Considerations: While glTF allows multiple sets, many real-time rendering engines and web viewers (such as Three.js, Babylon.js, or mobile pipelines) optimize shaders specifically for a single set of 4 influences. Exceeding 4 weights per vertex can trigger fallback shaders or cause rendering artifacts if the target runtime does not support multiple joint sets.
Normalization Requirements
The weights assigned to any single vertex must strictly sum to 1.0:
- Sum of Weights: Across all active sets
(
WEIGHTS_0,WEIGHTS_1, etc.), the sum of all components for a vertex must equal1.0. - Zero Influences: If a vertex is influenced by fewer
than 4 bones within a set, the unused weight components must be set to
0.0. - Floating-Point Drift: Export pipelines must normalize skin weights prior to serialization to avoid precision errors that cause mesh deformation artifacts.
Permitted Data Types
glTF dictates specific component types for both joint indices and vertex weights:
JOINTS_nTypes: Must use eitherUNSIGNED_BYTE(0 to 255) orUNSIGNED_SHORT(0 to 65,535). Floating-point values are not permitted for joint indices.WEIGHTS_nTypes: Can be stored asFLOAT, normalizedUNSIGNED_BYTE, or normalizedUNSIGNED_SHORT. Using normalized integer types significantly reduces file size, butFLOATis often preferred during export to avoid quantization errors.
Practical Mesh Preparation Guidelines
To ensure asset stability when exporting to glTF from 3D modeling suites like Blender, Maya, or 3ds Max:
- Clamp Max Influences: Explicitly limit the maximum skin influences to 4 per vertex before rigging or exporting.
- Prune Low Weights: Delete or zero-out negligible weights (typically values below 0.01) to keep the weight distribution clean and ensure critical joints receive accurate transformation priority.
- Run Explicit Normalization: Always use the software’s native "Normalize Weights" function as the final step in the skinning workflow before running the glTF exporter.