Skip to content
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

[glTF] Support bufferView stride (interleaved attributes) #472

Open
footballhead opened this issue May 24, 2024 · 1 comment
Open

[glTF] Support bufferView stride (interleaved attributes) #472

footballhead opened this issue May 24, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@footballhead
Copy link
Collaborator

The current implementation of GltfLoader::LoadMeshData assumes that each attribute is stored tightly packed. However, glTF allows for interleaved attributes, see 3.6.2. Trying to load interleaved data like it is tightly packed results in garbage output.

BigWheels should support interleaved attributes in order to correctly load models like:

@footballhead footballhead added the enhancement New feature or request label May 24, 2024
@footballhead footballhead changed the title [glTF] Support interleaved attributes [glTF] Support bufferView stride (interleaved attributes) May 31, 2024
@footballhead
Copy link
Collaborator Author

footballhead commented May 31, 2024

A curious case of this is SimpleTexture; the UVs are stored as four triples: (U_1, V_1, 0), (U_2, V_2, 0), (U_3, V_3, 0), (U_4, V_4, 0). If you stride the buffer then you only read the UVs and skip the 0. However, if you don't stride then you read (U_1, V_1), (0, U_2), (V_2, 0), (U_3, V_3)

@footballhead footballhead self-assigned this Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant