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
Recently I've been reported several issues related to BufferView not being defined when loading a model, often related to sparse accessors, but not limited to them.
At first sight it may look an oversight on my side with a solution as simple as removing these checks, but that would have been a disaster.
That validation prevents bigger problems to happen down the road because a key feature that is required.
As per the specification: 'When accessor.bufferView is undefined, the sparse accessor is initialized as an array of zeros of size'
This means that it is not enough to simply skip the validation: a placeholder buffer needs to be set in place an filled with zeros.
And this can be done in a number of ways, but there's a catch: the Accessor's data is exposed via a number of vertex attribute codecs that help encode and decode the bytes to meaningful values, and these codecs are designed to have read and write access. this means that a vertex attribute codec could be used to fill the placeholder buffer with non zero values, opening the door for incredibly hard to find errors.
So, in order to fix this apparently "simple" issue, it will be neccesary to completely redesign the BufferView, Accessor and vertex attribute codecs to discriminate between "ReadOnly" and "ReadWrite" buffers.
This is the next thing I'm going to work with, it will take a while, and it has the potential for API breaking changes.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Recently I've been reported several issues related to BufferView not being defined when loading a model, often related to sparse accessors, but not limited to them.
At first sight it may look an oversight on my side with a solution as simple as removing these checks, but that would have been a disaster.
That validation prevents bigger problems to happen down the road because a key feature that is required.
As per the specification: 'When accessor.bufferView is undefined, the sparse accessor is initialized as an array of zeros of size'
This means that it is not enough to simply skip the validation: a placeholder buffer needs to be set in place an filled with zeros.
And this can be done in a number of ways, but there's a catch: the Accessor's data is exposed via a number of vertex attribute codecs that help encode and decode the bytes to meaningful values, and these codecs are designed to have read and write access. this means that a vertex attribute codec could be used to fill the placeholder buffer with non zero values, opening the door for incredibly hard to find errors.
So, in order to fix this apparently "simple" issue, it will be neccesary to completely redesign the BufferView, Accessor and vertex attribute codecs to discriminate between "ReadOnly" and "ReadWrite" buffers.
This is the next thing I'm going to work with, it will take a while, and it has the potential for API breaking changes.
Feel free to comment
Beta Was this translation helpful? Give feedback.
All reactions