-
Notifications
You must be signed in to change notification settings - Fork 65
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
Fixed sparse accessor validation #18
Conversation
The sparse accessor values are displacements, so they should be added to the original values, instead of completely replacing them
|
Where does this come from? Here's an initial discussion: |
Maybe it's a basic misunderstanding on my side. As you can see, I originally interpreted it in the way that you now referred to it. In hindsight, cannot say for sure where this confusion came from. But I remember that my interpretation of storing displacements originally came up when creating the "Morph Targets" section of the glTFOverview. And I think that it stems from this part of the spec: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#meshes It says (emphasis by me)
If the targets store new positions, this does not make sense. Having an original mesh containing a single vertex at (1,0,0) and combining it, with a weight of 1.0, with single a target that also stores the position of (1,0,0) would yield the position (2,0,0). A result of (2,0,0) would only be correct if the target stored a displacement. All this is somehow related to the
and the conclusion in #210 seemed to be that only So to summarize, I think that storing real positions (instead of displacements) in sparse accessors does not make sense together with the
but think that the current state is at least confusing (if not plainly wrong - but if there is a basic misunderstanding on my side, please let me know). (EDIT: Obviously, this would rather belong into the glTF repo, and not the validator repo, but maybe we can figure out here whether it is an issue at all, or just caused by me not properly reading the spec...) |
I can see now how could relations between morph calculations and sparse storage be confusing.
Only when using initial positions as base accessor. I'd expect that sparse accessors that are used for morph targets will have undefined One could argue that it would be cleaner to use accessor with initial positions as "base" for sparse accessors and apply |
Yes, in the meantime, I also realized that I mixed up two completely unrelated concepts (and was just about to update my previous comment, but you already summarized it). The point is that
are completely unrelated. So my conclusion for now is that the morph targets should only contain displacements. (The fact these displacements will usually (but not necessarily) be stored using sparse accessors is unrelated and independent of the fact that the |
For the sparse accessor sample that I created for KhronosGroup/glTF-Sample-Models#99 (comment) , the validator reported an error:
According to my understanding, the values that are stored in the sparse accessors are really displacements. They are not supposed to replace the original values. Instead, they should be added to the original values.
(Maybe the spec could be reworded slightly. It refers to this process as "substitution", which sounds like the values should be replaced. Referring to it as "displacement" or "deformation" might be less confusing. I also stumbled over this, and fixed it in javagl/JglTF@6eac4bc )