-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[models] Window hangs when loading certain obj files #2219
Comments
It seems an issue with |
What implementation/library do you have in mind? |
@techbech After reviewing several libraries I'm considering a custom implementation. The reason is because raylib has several requirements that unfortunately no obj loader provides (or at least I couldn't find a library providing them). I need:
|
Issue is related to an external library. |
Please, before submitting a new issue verify and check:
Issue description
On loading an
obj
file generated by leocad, when importing the object, instead of showing the model, the window hangs, and after a few seconds, my OS prompts me to force kill the process or waitIt appears this is an issue due to the high number of
newmtl
declarations in mymtl
file, as any number greater than9
will reproduce this hang in my testingI traced down the issue to an endless loop in tinyobj_loader_c.h, which from what I understood, tries to repeatedly expand the size of the hash table until it can successfully add a value in. However, the function
hash_table_maybe_grow
will not expand the size of the table because of the hash table still having some space leftAnd the function
hash_table_insert
always returns a failure because the loop inhash_table_insert_value
always goes over the list and does not find a match, making the function repeatedly re-try to insert the value without anything changingEnvironment
OS: Ubuntu 21.04
INFO: GL: OpenGL device information:
INFO: > Vendor: Intel
INFO: > Renderer: Mesa Intel(R) HD Graphics 620 (KBL GT2)
INFO: > Version: 4.6 (Core Profile) Mesa 21.2.2
INFO: > GLSL: 4.60
Test Files
OBJ file
MTL file
The text was updated successfully, but these errors were encountered: