You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this correct? or is the byte offset property only meant to be applied to the "regular" data pointer?
I couldn't find any glTF sample file so far that'd have non-zero byte offsets while using sparse accessors.
The text was updated successfully, but these errors were encountered:
The accessor.byteOffset is applied only to the data from accessor.bufferView (if the latter is used). The sparse data structure has dedicated offsets - accessor.sparse.indices.byteOffset and accessor.sparse.values.byteOffset - for sparse indices and values respectively.
I found it helpful to think of accessor.sparse.indices and accessor.sparse.values as being "instances of the type Accessor": They define the data layout of a part of a buffer view. And as such, they contain everything that an accessor contains, and are somewhat independent of the accessor that contains them.
(Yes, the values essentially inherit the component type from the containing one, and of course they cannot contain further sparse accessors on their own - but on an abstract level, they are "the same data structure as an accessor")
Thanks both for the quick answers and clarification 🙂
Having a glTF sample file with non-zero byte offsets for the sparse index and value buffers would be quite useful to catch these, but closing this issue now as my problem is resolved.
I have been trying to figure that one out from the specifications but I can't seem to quite confirm the expected behaviour here for a glTF importer.
Currently, I apply the byte offset property from the accessor to both the "regular" data and the sparse data, like so:
Is this correct? or is the byte offset property only meant to be applied to the "regular" data pointer?
I couldn't find any glTF sample file so far that'd have non-zero byte offsets while using sparse accessors.
The text was updated successfully, but these errors were encountered: