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
The faces reported with scene.mesh_list[0].faces are:
[[1, 0, 2], [1, 0, 2]]
meaning that they don't index the interleaved array, because the second face should be [4, 3, 5]
Any ideas how to achieve interleaved indexing, without it I cannot render in OpenGL using glDrawElements by pushing the interleaved array into a VBO, and faces into an EBO (index buffer)
The text was updated successfully, but these errors were encountered:
Just draw with glDrawArrays. The obj format is so obscure you can't really do index buffer in all cases. If you have an obj file with one object that could be fine.
Thanks for pointing that out, glDrawArrays works. Yet for the lack of a Python library that would make an index array from OBJ, I ended up implementing a simple OBJ parser myself. At least for a 1 object per file, that works fine indeed, and saves about 15% of GPU memory
Yup. That should work ok for single object file. The problem with multi-object files is that a face can reference a vertex index in a previous object. The index is global for the entire file.
This library also create gltf-like version of the obj file when you use cache=True option. It creates a json file referring to locations in a data file. You can then just dump the bytes into a buffer and draw with glDrawArrays. Loading the object(s) will be near instant.
I don't know many cases today were saving memory for mesh data is that important.
With the test object:
The interleaved array of vertices is generated correctly:
The faces reported with
scene.mesh_list[0].faces
are:meaning that they don't index the interleaved array, because the second face should be
[4, 3, 5]
Any ideas how to achieve interleaved indexing, without it I cannot render in OpenGL using
glDrawElements
by pushing the interleaved array into a VBO, and faces into an EBO (index buffer)The text was updated successfully, but these errors were encountered: