gltf icon indicating copy to clipboard operation
gltf copied to clipboard

`Accessor` implementation not conformant with specification

Open chubei-oppen opened this issue 2 years ago • 1 comments

  1. The Validate implementation asserts buffer_view and sparse must not both be empty, which is actually allowed.

  2. The Accessor always has byte_offset even when buffer_view is none, which is not allowed.

chubei-oppen avatar May 31 '22 09:05 chubei-oppen

I just encountered this when trying to implement MSFT_lod with #348. The exact wording of the spec is:

The index of the buffer view. When undefined, the accessor MUST be initialized with zeros; sparse property or extensions MAY override zeros with actual values.

Therefore these lines should be removed:

https://github.com/gltf-rs/gltf/blob/51d8f5c5e9fde2740f1da83d248b26f6b8d015c8/gltf-json/src/accessor.rs#L233-L237

expenses avatar Jun 09 '22 16:06 expenses