-
Notifications
You must be signed in to change notification settings - Fork 594
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
Incorrect loading of vertex color when there is none #380
Comments
I cannot recall why default behavior is to create default vertex color. Probably to support parsing a .obj whose vertices partially have vertex colors, something like:
It'd be possible to add a condition(when all vertices does not have vertex color) to clear vertex colors here: tinyobjloader/tiny_obj_loader.h Line 3102 in cab4ad7
PR is much appreciated! |
Hmm, turns out setting |
Describe the issue
Tinyobjloader incorrectly populates the vertex color attribute with default values when vertex color does not exist in the file. It seems to be by design as shown in the comments below:
tinyobjloader/tiny_obj_loader.h
Lines 517 to 521 in cab4ad7
However, I want to argue that this behavior is really confusing (especially during debugging). It would better to leave color field empty if no vertex color exists in the file.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Tinyobject should not populate the color attribute.
The text was updated successfully, but these errors were encountered: