-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
The InverseBindMatrix of a skin is supposed
to bring coordinates being skinned into the same space as each joint
https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#skins
In fact, that is how the spec. functionally defines inverseBindMatrix.
As such, its value will be the
the inverse of the global transform of the respective joint, in its initial configuration.
as the gltf tutorial points out: https://github.com/KhronosGroup/glTF-Tutorials/blob/master/gltfTutorial/gltfTutorial_020_Skins.md#the-skin
So it could be optional (#461) as it can be computed by the viewer, or alternatively preapplied, and cannot be animated.
It would be a convenience/performance feature to help with fast loading.
A validator/loader could check if the supplied inverseBindMatrix is actually the inverse of the global (or perhaps relative to root) transform.
However, for some, perhaps most, glTF scenes this is not the case. For example, https://github.com/KhronosGroup/glTF-Asset-Generator/blob/master/Output/Animation_Skin/Animation_Skin_01.gltf has inverseBindMatrices which are unrelated to their joint transforms.
This then means that these matrices actually do not bring coordinates being skinned into the same space as each joint. While the spec. seemingly is at odds with that usage, it is a result of the actual dual purpose of the matrix. The second purpose is to optionally serve as bind shape matrix, bringing the mesh into the initial pose expected by the animation of the joints. This is pointed out by the implementation note which seems to contradict the intended functional definition of the matrix.
Just from the terse spec. language and without further information from tutorials, examples or other implementations it would be neigh impossible to divine how inverseBindMatrix needs to be taken into account during skinning.
What about renaming the matrix by getting rid of 'inverse' and call it more generally jointBindMatrix ? And then redefining its function to be more general as the first and unmutable transform which needs to be applied to a skinned vertex, perhaps augmented by its intended use as a combined inverse bind and shape matrix.
At least this is how its current usage comes across. If it is too late for renaming in a future version, clarifying its functional definition may still be possible.