SharpGLTF icon indicating copy to clipboard operation
SharpGLTF copied to clipboard

[BUG] Accessors with sparse storage but without bufferView fail validation

Open seberoth opened this issue 2 years ago • 9 comments

Describe the bug If a accessor uses sparse storage but hasn't defined a bufferView, the validation fails with Message: Accessor[13] _bufferView: must be defined. The gltf spec says thats allowed but the accessor MUST be initialized with zeros.

GLTF 2.0 Accessor specs

To Reproduce Example glb file is attached

please complete the following information:

  • OS: Windows 11
  • SharpGLTF Version: 1.0.0-alpha0030

example accessor

    {
      "componentType": 5126,
      "count": 7251,
      "sparse": {
        "count": 5920,
        "indices": {
          "bufferView": 13,
          "componentType": 5123
        },
        "values": {
          "bufferView": 14
        }
      },
      "type": "VEC3"
    }

a0_005_ma__strongarms_int_l.zip

EDIT: Probably related Blender GLTF plugin commit: https://github.com/KhronosGroup/glTF-Blender-IO/commit/9ea179aacb8b93efbca78af723745e73f4c61e86

seberoth avatar Nov 18 '23 11:11 seberoth

Yes, this is a known issue; for some reason I don't undersand (and I don't fully agree) Khronos accepts glTF with missing buffers as valid.

The problem is that supporting missing buffers breaks some stuff inside the APIs, so I am still reasearching for a proper solution.

vpenades avatar Nov 20 '23 07:11 vpenades

I recalled I already asked about this issue here https://github.com/KhronosGroup/glTF-Validator/issues/189

I'll investigate a solution...

vpenades avatar Dec 01 '23 21:12 vpenades