Closed droettger closed 9 months ago
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.
This was fixed recently with https://github.com/spnda/fastgltf/commit/73673cc48803c53a103a6c1ca2bd45ff6c9b56da.
Follow-up to https://github.com/spnda/fastgltf/issues/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 Thecontinue
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.