-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sparse accessors are not handled correctly by iterators #154
Comments
The library currently does not expose sparse iterators. I expect what you currently render is the 'base case' where vertices are not perturbed. |
I'd still call it a bug. The iterators should at least fail instead of delivering wrong data if the underlying accessor is sparse. |
Let's fix this before the next release. |
Possibly helpful: https://github.com/bwasty/gltf-loader-ts/blob/3b44a0e9c58c3bb5092ac8586e1bc9779e92f1b0/source/gltf-asset.ts#L91-L115 (TypeScript implementation I did a while ago). |
I'm attempting this now. It's quite difficult to achieve for all accessors. I suggest we start with morph targets (positions, normals, and tangents) and expand from there. |
Our handling of sparse accessors is more broken than originally thought! |
I haven't looked into the code for a while (and I'm currently traveling), but I wonder what makes it so hard to do generically for all accessors - in TypeScript (linked above) I found it surprisingly easy in the end. |
The SimpleSparseAccessor sample model is rendering like this in my viewer:
![simplesparseaccessor](https://user-images.githubusercontent.com/1647415/37211602-c3221f28-23ac-11e8-8fa0-9af96dac7155.png)
It should look like this:
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/SimpleSparseAccessor
Looking at the data layout / geometry explanations (in the sample model readme), it seems to me like sparse accessors are not considered by the iterators.
The text was updated successfully, but these errors were encountered: