Skip to content

Fix unused joint indices#559

Merged
bghgary merged 1 commit intomasterfrom
fix-unused-joints
Jan 22, 2020
Merged

Fix unused joint indices#559
bghgary merged 1 commit intomasterfrom
fix-unused-joints

Conversation

@lexaknyazev
Copy link
Member

This PR fixes ACCESSOR_JOINTS_USED_ZERO_WEIGHT warning for Animation_Skin_07 and Animation_Skin_10.

Similar code in CreateJointsAndWeightsForMultipleRoots was not edited because it's currently unused.

@lexaknyazev lexaknyazev requested a review from bghgary January 22, 2020 09:26
@lexaknyazev lexaknyazev mentioned this pull request Jan 22, 2020
4 tasks
Copy link
Collaborator

@bghgary bghgary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I understand this skin warning in the validator. Are we saying we must use joint index 0 if the weight is 0?

@lexaknyazev
Copy link
Member Author

Yes, the validator follows this statement from the spec:

Unused joint values (i.e. joints with a weight of zero) should be set to zero.

The reasoning is:

  1. There could be cases when a vertex has less than 4 influences.
  2. Yet, the accessor is VEC4, so something must be written to missing joint indices.
  3. Given that we decided to not introduce a "special" index value (like 255 or 65535) for unused influences, there's no way to distinguish between truly unused (as if there are only 3 joints total) and "normal" zero-weight (like in this example) influences.
  4. Therefore, all zero-weight influences should have zero joint index.

@bghgary
Copy link
Collaborator

bghgary commented Jan 22, 2020

Yeah, I vaguely recall this discussion now. Thanks!

@bghgary bghgary merged commit ad98f08 into master Jan 22, 2020
@lexaknyazev lexaknyazev deleted the fix-unused-joints branch January 22, 2020 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants