glTF-Validator icon indicating copy to clipboard operation
glTF-Validator copied to clipboard

Skin vertex weight normalization

Open ziriax opened this issue 4 years ago • 5 comments

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 avatar Jul 16 '20 16:07 ziriax

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?

lexaknyazev avatar Jul 16 '20 17:07 lexaknyazev

Here is an example (and old, non-normalized version of CesiumMan) that passes validation but in fact has non-normalized weights: https://github.com/google/model-viewer/issues/2450#issuecomment-902428164

elalish avatar Apr 05 '22 18:04 elalish

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

lexaknyazev avatar Apr 05 '22 19:04 lexaknyazev

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

elalish avatar Apr 05 '22 20:04 elalish

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

elalish avatar Apr 05 '22 20:04 elalish