-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify skinning #1784
Comments
The
Looking for a transform is probably not a good way to assign the skeleton property. It indicates a semantic root of the skeleton, which may be helpful to software in which nodes and bones are not mixed in the node hierarchy, to preserve object types. In short, it is just a hint. If a
Joints must belong to a single scene. If they have no common ancestor other than the scene, the scene itself is necessarily the common ancestor. In that case the |
As i understood the spec, the joints form a tree of joints, that tree of joints is transformed by the transform of the node from which it starts, in this case, the node the skeleton property is pointing to. Therefore, the skeleton property is not just a semantic hint, it has a real meaning and having or not having the property can make a scene comlpetely different. With that in mind, if the skin doesn't have a skeleton property, which should be considered as the "node from which it starts"? |
The spec is, at the very least, exceedingly unclear. It's been like that forever. Is it ever going to have the actual formula to use added? The formula is in the overview or the tutorials. The world space position of a vert is
where
The use of |
An issue to extend the skinning section in the spec with a (non-normative) section that contains further details has been on my bucket list for quite a while now - see #1504 (comment) . Before adding something like this to the spec, however, I'd like to create further examples that show the differences of implementing skinning properly and point out possible pitfalls in the implementations. The most recent attempt of creating a representative (but simple) example was at KhronosGroup/glTF-Sample-Models#243 ... |
Thanks @scurest , now is a bit more clear. The spec is very confusing and it looks like the formula should be:
That is why I was completely confused. |
@javagl Thanks a lot for writing the formulas up. You're the only reason I could figure out how it was supposed to work at all.
Why non-normative? My whole point is the spec should normatively define how skinning works so everyone agrees how to do it. |
Another interesting test is to set scale to [0,0,0] on the node with the skinned mesh in SimpleSkin. If it's really being ignored there should be no effect. The formula with The Babylon viewer passes this test, but the Three.js viewer appears to fail it. |
Regarding the "non-normative" part: Things that are going into the spec have to undergo a ratification process, so it's not entirely trivial to change the spec "just so". It might be part of the next glTF version, though. (And first having it as a non-normative section would increase the chance that it will undergo a critical review by people who are actually using it as the basis for their implementations). Regarding the "scaling to 0,0,0" idea, I'd have to check whether this is actually allowed by the spec. Regardless of that: There are certain errors in implementations of skinning that can be observed occasionally. E.g. even for the (intentionally) most simple possible example of skinning, some viewers created wrong results (see KhronosGroup/glTF-Sample-Models#243 (comment) ). Again, there are some tasks on my TODO list regarding skinning (and I'm juggling with the priorities), but these tasks include, among others, to figure out
(some details are mentioned in the PR 242, but I haven't yet allocated (enough) time for that) |
I think I have now completely understood this. The issue comes by comparison with Kuesa engine. In Kuesa, we add the skeleton as a component of an entity, and the skeleton is transformed by the global transform of the entity. Therefore, our joints are relative to the entity. We can close this issue if you want |
Two more doubts about skins: Is it possible that a skin mark as joints nodes that are directly the scene root? For example
or even more complicated case
|
Yes, and you do see "gaps" in the wild. This is one of the things #1747 tries to restrict more heavily.
The spec says
which appears to forbid that (although it wouldn't matter to how skinning works). edit: donmccurdy's comment above suggests that the scene itself could function as a common root. |
Thanks @scurest |
For testing the Blender importer, I use the files from all the issues listed at the top of KhronosGroup/glTF-Blender-IO#857 since they all previously presented some kind of difficulty when importing. |
It looks like all of the OP questions have been resolved. The updated AsciiDoc version of the spec includes the clarified skinning section. |
I have read that skeleton property can be ignored by importers (#1403)
I would like to know what happens in a case like the following:
From the docs it is clear that the transform of the node containing the mesh should be ignored, but how should we interpret the transform for the skeleton itself?
The skeleton has a common ancestor with a transform. Should we apply that transform to the skeleton? If one uses the skeleton property, it can set it to be the common ancestor with the transform but also the one without the transform. Why should we select one or the other?
Also, what happens if there is no common ancestor and the joints come directly from the scenes array?
The text was updated successfully, but these errors were encountered: