Help w/ vertex color from Blender 4.2 -> PlayCanvas?

I have a few models in Blender 4.2 with some vertex colors. Some of the vertex colors are painted, some are baked from lighting/all sources.

This is a test cube exported to gltf. The model looks good in Blender w/ this material setup. Then I export to gltf (making sure the export settings → Mesh → Vertex color exporting is enabled). In gltf-viewer, the vertex also colors appear fine (top left in my screenshot).

However, once uploaded to PlayCanvas, if I enable the Vertex Color prop on the material’s diffuse channel, it comes through all scrambled w/ colors I didn’t include (bottom left in my screenshot - there are no dark blue/purple areas on my cube, for ex, and there are in PlayCanvas).

Posted the same test cube on my Google Drive here if it’s helpful: Test Cube - Vertex Color + Principled.glb - Google Drive

I’ve tested a few other material setups, like for unlit materials, and none work quite as expected. My vertex color attribute in Blender is of type Face Corner → Byte Color, but I also tried the other options to no avail. I’ll also note that vertex colors come through largely as expected using .fbx export → PlayCanvas.

Is this a new bug? Or am I just doing something wrong? Let me know if anyone has a hunch, thanks!

It’d be worth testing with a cube from here, to see if this works: glTF-Sample-Models/2.0/BoxVertexColors at main · KhronosGroup/glTF-Sample-Models · GitHub

Tested. The cube you linked looks good in gltf-viewer. However this cube is pure vertex color and no material - so PlayCanvas can’t read it at all and you can’t even add a new material it.

The cube you linked also imports into Blender with no material, so there’s no way for me to reverse engineer the material setup to export to vertex colored mats going forward. Rats.

Good suggestion, though!

1 Like

I can definitely confirm that it does not import correctly to the Editor.
Viewing it here works well, so that means the engine can render it correctly: Model Viewer

But the import into the Editor messes it up.
I created an issue for it, but I suspect it won’t be fixed before the early Jan. Please ping again early Jan as a follow up.

@slimbuck

1 Like

I had the same situation - Blender 4.2 export an object with Vertex colors only and one material as @jamesckane had shown above. I found out that I can check the »Vertex Color« option for Material/Diffuse after the PlayCanvas GLB import to show the vertex colors - see attached images. @mvaligursky could you solve the import issue or do we just need to check the »Vertex Color« option to show them?


@uhu - I added your request as a comment here: Incorrect import of glb with vertex colors · Issue #1241 · playcanvas/editor · GitHub

:+1: