hhoria
March 14, 2022, 11:54am
#1
Hi everyone,
I’m trying to use diffuse or emissive vertex colors of this draco compressed glb .
In https://gltf.report/ it seems to render nicely out of the box, but in playcanvas there are just some tiny specs of color (not sure even those are correct …
I’m using this draco loader Loading Draco Compressed GLBs | Learn PlayCanvas , mesh seems to load fine
glb has normals, and colors
playcanvas:
gltf.report:
utils.loadGlbContainerFromUrl(completeURL, null, 'downloadedModel', function(err,asset){
var renderRoot=asset.resource.instantiateRenderEntity();
renderRoot.localScale=pc.Vec3.ONE;
self.entity.addChild(renderRoot);
renderRoot.localEulerAngles=new pc.Vec3(0,0,0);
renderRoot.children[0].render.meshInstances[0].material=self.solidMaterial.resource;
renderRoot.children[0].render.meshInstances[0].material.emissiveVertexColor=true;
renderRoot.children[0].render.meshInstances[0].material.emissiveVertexColorChannel='rgba';
renderRoot.children[0].render.meshInstances[0].material.update();
});
Not sure what the problem could be. My cube with vertex colors test works in our viewer: PlayCanvas glTF Viewer
(see it attached)
BoxVertexColors.zip (6.8 KB)
1 Like
hhoria
March 14, 2022, 2:47pm
#4
I also have the raw uncompressed glb if it’s of any help.
It’s quite a big difference, from ~140 mb down to ~6.6 mb
This one doesn’t show the vertex colors either.
Also, If I import it in playcanvas as a .dae and use it locally, it’s working
hhoria
March 15, 2022, 7:41am
#5
My bad, the uncompressed one does show the vertex colors correctly, it just takes a while to load after finishing the downloading
hhoria
March 15, 2022, 7:44am
#6
Same draco loader for uncompressed one, just replace the url;
The playcanvas viewer doesn’t show the vertexcolor but the playcanvas app does
in the playcanvas app:
2 Likes
Just to confirm, it doesn’t work in the viewer but works fine in a project?
hhoria
March 15, 2022, 10:00am
#8
So here’s how vertex colors are currently working:
uncompressed glb, works in the project but shows just white in the viewer
draco compressed glb shows white (with some small color specs, randomly, as in the 1st picture of the thread) in the project, but white in the viewer
will
April 2, 2022, 6:12pm
#10
I have done an investigation here:
opened 10:15AM - 15 Mar 22 UTC
bug
area: graphics
area: gltf
Forum: https://forum.playcanvas.com/t/draco-glb-diffuse-emissivevertexcolor/2476… 9
Test project with Draco and uncompressed GLBs: https://playcanvas.com/editor/scene/1363413
<img width="1273" alt="image" src="https://user-images.githubusercontent.com/16639049/158355893-89fe7608-3837-4668-a0d3-6b6476a94061.png">
Should look like this:

I suggest somebody on the graphics team follows up on Monday.
1 Like
will
April 23, 2022, 9:41am
#11
This has now been fixed by this PR:
playcanvas:main
← playcanvas:mvaligursky-glb-vertex-colors
opened 01:56PM - 22 Apr 22 UTC
Fixes https://github.com/playcanvas/engine/issues/4118 (great investigation and … solutions @willeastcott )
- instead of using DefaultMaterial for missing materials inside GLB, use GLB specific default material
- assume 8but colors in draco compressed glb format are normalized (some compressor don't set that flag correctly, I've seen it few times in the past)
This fix will be included in a forthcoming engine release (1.54.0).
2 Likes