Skip to content

Vertex colors don't load #27

@camnewnham

Description

@camnewnham

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:

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 9f5161b

Expected Behaviour

In three.js:
image
Point Cloud (vertex colors) on left, Mesh (vertex colors) in center, Mesh (no colors) on right.

Actual Behaviour

In GLTFast/DracoUnity:
image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions