KhronosGroup / KhronosGroup/glTF

Morph target weights across multiple mesh primitives are under-specified

Open
#2,612 2 comments 0 reactions 1 assignee Claimed by @lexaknyazev View on GitHub
Dominant language
HTML
Stars
7.8k
Forks
1.2k
Avg merge
17h 26m
Merged PRs (30d)
5

Description

https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#morph-targets

The glTF 2.0 specification is currently lacking in detail with regards to morph target weights. It talks about multiple morph targets, multiple morphed attributes, but hardly mentions multiple primitives. They are mentioned here:

> A morph target is a morphable Mesh where the primitives' attributes are obtained by adding the original attributes to a weighted sum of the target’s attributes.
>
> For instance, the morph target vertices POSITION for the primitive at index i are computed in this way:

...but the prefix of "for instance" hints at an example, which is not clearly normative. Then, the only other mention in the functional text is in this sentence:

> All primitives MUST have the same number of morph targets in the same order.

The spec should be updated to make the following clearer:

- Does each morph target in a primitive always activate alongside the corresponding morph targets in the other primitives? (I think: yes)

- Does each value in the weights array always activate all primitives together? Is it ever valid to separate them? (I think: yes and no)

- The [mesh schema](https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/schema/mesh.schema.json) describes weights with "The number of array elements **MUST** match the number of morph targets", but this should be clarified if it means overlapping or not. As written, one could make the mistake of thinking that 2 primitives with 2 morph targets each should have 4 entries in the weights array.

- Should empty morph targets `{}` be used as placeholders in all mesh primitives to make sure the amount matches? Even for mesh primitives with no morph target data at all?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.