Vertex Colors

Hi,

So we’re testing out Defold as a way of doing a HTML port of one of our unity titles. We have a pretty long running SVG -> Unity Meshes pipeline that basically converts illustrator files into meshes that only have vertex position and vertex colors. I’ve written an exporter from unity to DAE to get stuff into Defold.

Here’s the problem. I understand that Vertex Colors aren’t a thing in the Defold pipeline so I tried the swap colors for normals hack. Only to find that all the normals are normalised before they get to the shader so the colors become very broken. I’ve also tried encoding color as a rotation vector, throwing that in the normal and pulled it back out in the shader and the colors are still not right.

At this point I’m considering creating a texture of single pixel colors and creating UV’s that map to those pixels. Does anyone have a better idea?

Would love some help.

Matt

1 Like

Hi and welcome to the forum! I’ll refer this question to @sven or @Andreas_Tadic.

2 Likes

Unfortunately, I don’t see any good solution to this at the moment, maybe @sven does though?
We do have flexible vertex format on our roadmap though (3D-functionality) which would of course allow for this.

I would also be perfectly fine in just providing flat arrays of verts, colours and indexes and assembling it all at runtime or in editor. Is there some undocumented low level mesh access somewhere?

If I can keep everything as mesh we’ll retain our low file size and it should stay really sharp.

2 Likes