Hi everyone,
I encountered an error when I tried to register an instanced buffer for a cloned mesh.
Example: https://playground.babylonjs.com/#MHXX89#2
Reproduce:
It reproduces on 6.25.0. It works correctly on 5.71.1.
- Create a mesh and register an instanced buffer.
- Clone the first mesh.
- Register an instanced buffer for the cloned mesh.
It looks like clone copies instancedBuffers from source mesh. So, registerInstancedBuffer does not initialize _userInstancedBuffersStorage and instancedBuffers for instances.
So I found a temporary fix (line 18 in the example): cloneSphere.instancedBuffers = null
After ‘fix’ registerInstancedBuffer works correctly.
What side effects can I encounter using my ‘fix’?
Have any ideas about how to fix this better than I did?