Vertex Color doesn't show on compressed GLB

I load glb with vertex color if I dont compress it all ok BUT after compress playcanvas dont see vertex color (in babylon sandbox all ok)

what should I do to see my vertexColor

How are you loading the GLB? Are you importing it as an asset in the Editor and adding it to the scene or loading the GLB at runtime?

What do you mean by compress? Are you using Draco?

Can you share the GLB or an example GLB that has the the same issue?

yep of course I load it into playcanvas engine (I dont use editor it cant work with glb and I love work local)
this is my code

 public static async testEntityCreator(app:pc.Application, url:string, collision: boolean, name: string, color:boolean) {
    const assets = {
      asset: new pc.Asset(name, pc.ASSET_CONTAINER, { url: ASSETS_LINK+url })
    const loadArray = [
    // грузим!
    await loadAssetUrl(app, loadArray)
    const entity = assets.asset.resource.instantiateRenderEntity()
    if (color) {
      // // entity.render.meshInstances[0].material= new pc.StandardMaterial()
      // entity.render.meshInstances[0].material.diffuseVertexColor=true
      // entity.render.meshInstances[0].material.diffuseVertexColorChannel='rgba'
      // entity.render.meshInstances[0].material.update()
      // const buffer = entity.render.meshInstances[0].mesh.vertexBuffer
      // const iterator = new pc.VertexIterator(buffer)

      // // Iterate though all verticles 
      // for (let i = 0; i < 100; i++) {

      //   // Current vertex's position
      //   const posSem = iterator.element[pc.SEMANTIC_POSITION]

      //   // Get position
      //   const posX = posSem.array[posSem.index]
      //   const posY = posSem.array[posSem.index + 1]
      //   const posZ = posSem.array[posSem.index + 2]
      //   log.pc_shooter(iterator.element)
      //   // Move to the next vertex
      // }

      // iterator.end()

    if (collision) {
      window.entity = entity
      entity.addComponent('collision', {
        type: 'mesh',
        renderAsset: assets.asset.resource.renders[0]
      entity.addComponent('rigidbody', { 
        type: 'kinematic'
    return entity

and link for model factory.glb - Google Drive

side note: the Editor can now work with glb files

ok ) but what about vertex color?) I will stay localy with engine) my project too big for editor and I don’t enjoy how it work)

so what you can say about it?)

Looks like an issue on our side as our model viewer isn’t showing the colours but other viewers are

Created ticket here: Loading GLBs doesn't show vertex colours · Issue #5007 · playcanvas/engine · GitHub

Workaround for now is to use materials unfortunately.

I will wait your update to launch my game))

Hi @pblhelka ,

We have a PR for this Fix for draco vertex colors, which are stored as 16 bit for some reason by slimbuck · Pull Request #5008 · playcanvas/engine · GitHub. Thanks for providing a repo - your model is lovely!! <3<3


1 Like

THANK you ) oh I 'm sorry I’ve got your fix and include it in my repo but it still dont work((

I’ve just tried it in a test project (got the latest build from engine main branch) and it looks good