Exported glTF is sometimes invalid / doesn't pass glTF validation

The attached file has been exported from Nomad Sculpt directly.
It uses blend shapes / layers.

The file doesn’t pass validation in glTF Validator, as there are a number of small differences (rounding errors?) for some attributes:
https://github.com/mrdoob/three.js/files/8325401/blendshape-bugs.zip

Validation errors:

"messages": [
            {
                "code": "ACCESSOR_MIN_MISMATCH",
                "message": "Declared minimum value for this component (-1.3048517644165258e-7) does not match actual minimum (-5.736947059631348e-7).",
                "severity": 0,
                "pointer": "/accessors/0/min/1"
            },
            {
                "code": "ACCESSOR_ELEMENT_OUT_OF_MIN_BOUND",
                "message": "Accessor contains 233 element(s) less than declared minimum value -1.3048517644165258e-7.",
                "severity": 0,
                "pointer": "/accessors/0/min/1"
            },
            {
                "code": "ACCESSOR_MAX_MISMATCH",
                "message": "Declared maximum value for this component (0.1596701294183731) does not match actual maximum (3.8743019104003906e-7).",
                "severity": 0,
                "pointer": "/accessors/0/max/1"
            },
            {
                "code": "ACCESSOR_MAX_MISMATCH",
                "message": "Declared maximum value for this component (0.5000004768371582) does not match actual maximum (0.5000005960464478).",
                "severity": 0,
                "pointer": "/accessors/0/max/2"
            },
            {
                "code": "ACCESSOR_ELEMENT_OUT_OF_MAX_BOUND",
                "message": "Accessor contains 1 element(s) greater than declared maximum value 0.5000004768371582.",
                "severity": 0,
                "pointer": "/accessors/0/max/2"
            }
        ],

Fixed a while ago in Nomad Change Log - #40 by stephomi (no log entry about it though).

You’ll still have the “error” concerning the colour in morph if you enable export extra paint. (not an issue as no one supports colours in morph).

Thanks!
I’m using the latest release though and I don’t think “enable extra paint” was on but I’ll double-check.

Also, I was thinking about adding color morph support to three.js (and thus model-viewer), so “no one supports that” might not necessarily be an issue here :wink:

The problem is color in morph is not really well defined in gltf, and I don’t really respect the spec either.
See my comment in Validator fails for COLOR_0 in MorphTargets · Issue #178 · KhronosGroup/glTF-Validator · GitHub

Note that in Nomad the packing in morphs will change in next release.
At the moment it’s

_COLOR_0 VEC3 (RGB=Color)
_COLOR_1 VEC3 (R=Roughness, G=Metalness, B=SharedAlpha)

But now it will be

COLOR_0 VEC4 (RGB=Color, R=ColorAlpha)
COLOR_1 VEC4 (R=Roughness, G=Metalness, B=RoughAlpha, A=MetalAlpha)

Initially I was using separate _ROUGHNESS, _METALNESS and MASK (base only) channel, but:

  • gltf requires 4-bytes padding so it wastes ton of memory for nothing
  • blender ignores the channels that it doesn’t recognize

Understood, thanks for the details.
I’ll nonetheless give color morph implementation a shot in three.js at some point - interesting that those other attributes also come along, I wasn’t aware of that!

Just to follow up here, wanted to report as issue that morph target colors are packed into _COLOR_0 instead of COLOR_0 but saw that this is already part of what you wrote here.

Out of curiosity, when you say “Next Release”, when would that approximately be?
Thanks!

I don’t know but it might take a while.