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

gl_viewer skips primitive morph targets #37

Closed
droettger opened this issue Dec 11, 2023 · 2 comments
Closed

gl_viewer skips primitive morph targets #37

droettger opened this issue Dec 11, 2023 · 2 comments
Labels
bug Something isn't working done Everything has been addressed examples Issues related to the examples provided

Comments

@droettger
Copy link

droettger commented Dec 11, 2023

Follow-up to #36

Using continue when the accessor has no buffer view index for TEXCOORD_0 is incorrect.
https://github.com/spnda/fastgltf/blob/main/examples/gl_viewer/gl_viewer.cpp#L423
The continue only works for the position attribute because that is strictly required.

For all other attributes that needs to be a runtime check, like in this case if (texCoordAccessor.bufferViewIndex.has_value()) to just skip the VAO 1 setting.
The per mesh glVertexArrayElementBuffer at the end must still be done unconditionally or OpenGL will complain about an invalid input data types.

@spnda spnda added the bug Something isn't working label Dec 11, 2023
@spnda spnda closed this as completed Dec 11, 2023
@spnda spnda reopened this Dec 11, 2023
@spnda
Copy link
Owner

spnda commented Dec 11, 2023

The check is whether the UV accessor has a buffer view associated with it. The example doesn't support sparse accessors at all currently. but I guess I could fix that fairly quickly by refactoring the code to use fastgltf::copyFromAccessor into some GL buffer. However, I wanted to keep the example fairly simple, so currently it just doesn't support sparse accessors and I honestly don't feel like completely refactoring how the example works for adding sparse accessor support. I'll leave this open as a reminder though.

@spnda spnda changed the title gl_viewer skips glVertexArrayElementBuffer setting for primitives without texture coordinates gl_viewer skips primitive morph targets Dec 11, 2023
@spnda spnda added the examples Issues related to the examples provided label Jan 30, 2024
@spnda
Copy link
Owner

spnda commented Feb 21, 2024

This was fixed recently with 73673cc.

@spnda spnda closed this as completed Feb 21, 2024
@spnda spnda added the done Everything has been addressed label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working done Everything has been addressed examples Issues related to the examples provided
Projects
None yet
Development

No branches or pull requests

2 participants