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

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