-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Vertex colors don't load #27
Comments
Here is an example file for reproduction: bunny_mesh_color.zip |
first suspicion: Unity cannot work with uint8 vertex colors. |
confirmed! I hacked in a uint8->float conversion and then it's correct: Next steps:
If not:
The "if not" part, unfortunately, is quite some work. Easy workaround should be to encode colors as floats (untested) |
As it turned out, Unity can work with normalized uint8 colors, if you properly declare them as @camnewnham I'll release this fix soonish, but would appreciate if you could run a quick test with current main branch. Thanks! |
Thanks so much for the fix, @atteneder! I have a Piglet customer who is having the same issue (vertex colors not correctly loaded from their Draco-encoded model). I'll test the HEAD version of DracoUnity with Piglet and let you know if it works! |
It works! I just confirmed that the vertex colors load correctly in Piglet using the HEAD DracoUnity version. I tested with Unity 2020.3.9f1, using the bunny model above and also with the example model that my customer shared privately. |
Thanks @atteneder, good find! |
I know this is old, but thank you for the fix! I had |
* fix: Sub-package install timeout never actually triggered. * refactor: Removing code smell * chore: Bumping sub-package versions
Description
I've been working on #16 and run into an issue where vertex colors don't load either for meshes or point clouds.
The vertex attribute descriptors appear correct:
VertexAttribute=Color, VertexAttributeFormat=UInt8, numComponents=4, elementSize=4
Attempting to access
unityMesh.colors
results in:If the resulting array (from
unityMesh.colors
) is read the results are all rgba(0,0,0,0), hence the black.This applies to both point clouds (in my WIP implementation) and meshes (in
main
)There's minimal discussion of MeshData online, but I did see this which suggests it could be a Unity issue.
Colors do load correctly in
GLTFast
when models are not draco compressed.Environment
Unity 2020.3.15f2
DracoUnity
main
9f5161bExpected Behaviour
In three.js:
Point Cloud (vertex colors) on left, Mesh (vertex colors) in center, Mesh (no colors) on right.
Actual Behaviour
In GLTFast/DracoUnity:
The text was updated successfully, but these errors were encountered: