Glb object disappears after material is added to it


I came to a problem, where my GLB exported model becomes completely transparent as I change material of that object even though I am certain the object is still in the scene (checked it with click listeners etc.).

I am sharing with you an exported GLB model, where there are two nodes in it

  1. Model of human bones (literally bones)
  2. Some generic model of chair downloaded from internet

When I apply whatever texture (ex. wood.jpg from dropbox folder) to the first model node, it “disappears” but when it’s applied to the second model node - it works just fine.

Steps to reproduce my problem:

  1. Upload failing_textures.glb to SANDBOX from my dropbox folder mentioned at the bottom of this question
  2. Go to inspector
  3. Create standard material with emissive texture of wood.jpg (also in dropbox folder)
    3.1 Also fails with PRB material with albedo + metallic roughnes of wood.jpg
  4. Change active material of both first and second node with newly created material to see the first one disappear

Just to mention - applying that material in blender works as expected, also when I export that GLB file with textures and display it with babylon it works also as expected.

The only problem is when I try to apply texture on client side programmatically - which is what I need to achieve but am failing with that particular “human arms bones” model.

Playground is probably not necessary as I am doing that material change programatically and it can be reproduced at sandbox.

I don’t even know where to target my further research - if it could be babylon bug, corrupted glb file, corrupted glb file after it’s exported via blender,…

Any directions would be appreciated as I am stuck on this for quite long time.

Thanks in advance.

(Using 4.2 Babylon)

glb file + example texture

Playground is always useful :slight_smile:
So I created one -

As you see, there is only one material, so both meshes have the same material and the same texture.

Let’s create a new PBR material and apply it to the bones mesh -
For some reasons bones disappears! Since our new material is OK and tested the problem seems to be in the mesh itself. Inspector helps to quickly find out what is wrong, and here we are - Babylon.js Playground - final solution.

The parameter
scene.getMeshByName("Shape_IndexedFaceSet").useVertexColors = false;
did the trick :slight_smile:


Thanks - good point.
Even though I need to investigate more this guided me to correct direction.

1 Like