Disappearing mesh/material on registerInstancedBuffer and instancedBuffers?

See the image before and after in my game where I try to change color on a instanced item using registerInstancedBuffer on source mesh and instancedBuffers.color on the instance.

There are no errors, and once I apply the mesh disappears… Any clue why this happens ? I do use some optimization and the engine runs offscreencanvas. And I am unable to reproduce the error on playground.


You should use instanceColor instead to not conflict with the “color” attribute used for vertex colors

I found out this about instancedBuffers and colors.

  1. Create mesh and instances first.
  2. Wait one second by using SetTimeout
  3. Register instancedBuffers and set instanceColor
  4. Meshes disappears.
  5. Remove Timeout for one second and it works as expected.

You can see this playground example: Babylon.js Playground

Is this normal behavior ?

Seems to be a weird bug, I ll look into it ASAP.


Will be fixed by Fix registerInstancedBuffer after Mesh creation by sebavan · Pull Request #12609 · BabylonJS/Babylon.js · GitHub