Vertex colors don't load
See original GitHub issueDescription
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:
Unsupported conversion of vertex data (format 6 to 0, dimensions 4 to 4)
UnityEngine.Mesh:get_colors ()
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
https://github.com/atteneder/DracoUnity/commit/9f5161b5eec0c99425ec0e207ec1e7df5eea5cd1
Expected 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:
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Thanks @atteneder, good find! Confirming that this works for me.
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.