Skip to content
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

Skin vertex weight normalization #144

Open
ziriax opened this issue Jul 16, 2020 · 5 comments
Open

Skin vertex weight normalization #144

ziriax opened this issue Jul 16, 2020 · 5 comments

Comments

@ziriax
Copy link

ziriax commented Jul 16, 2020

The spec says:

The joint weights for each vertex must be non-negative, and normalized to have a linear sum of 1.0. No joint may have more than one non-zero weight for a given vertex.

The validator seems to check if the weights sum to one in groups of 4

Is this the desired behavior?

E.g. all of my customer's models have 8 weights. If feels more logical to me that the sum of these 8 weights should be one?

I'm trying to fix Maya2glTF to get rid of the normalization errors like these:

Weights accessor elements (at indices 2744..2747) have non-normalized sum: 0.9999983310699463

@ziriax ziriax closed this as completed Jul 16, 2020
@ziriax ziriax reopened this Jul 16, 2020
@lexaknyazev
Copy link
Member

The weights sum is accumulated across all weights sets (4, 8, 12, etc). The error message may be better, though.

Could you please provide an example asset?

@elalish
Copy link

elalish commented Apr 5, 2022

Here is an example (and old, non-normalized version of CesiumMan) that passes validation but in fact has non-normalized weights: google/model-viewer#2450 (comment)

@lexaknyazev
Copy link
Member

Both models from that archive have unorm8 skinning weights. The CesiumMan.quantize-hi.glb shows 320 relevant validation errors.

@elalish
Copy link

elalish commented Apr 5, 2022

yeah, the quantized one is being caught just fine. But the base one just has a single warning, yet is still invalid.

@elalish
Copy link

elalish commented Apr 5, 2022

Hmm wait, unorm8 skinning weights; that sounds like they just need to be divided by 255, yes? Maybe that is our bug; thanks!

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

No branches or pull requests

3 participants