Open darkvertex opened 4 days ago
Also to be clear, I don't believe this is an issue with threejs as there is an official example showing dynamically changing instance counts on the same InstancedMesh working no problem:
https://threejs.org/examples/?q=inst#webgl_instancing_dynamic
Describe the bug
I took a stackblitz from @alvarosabu demonstrating TresJS with an InstancedMesh with a bunch of ondulating Suzanne monkey heads, and then I edited the code so it starts with a ref() count of 3, and on each
@click
of the InstancedMesh, it is SUPPOSED to increment the count by 1 but then breaks.I am developing something with a realtime floor map showing people markers, and the number of people changes dynamically as they enter the room, potentially every few seconds. Everything worked great with static count values but breaks when it changes dynamically. :/
It errors like this:
(and no, I'm not setting .position on the InstancedMesh, so not sure what that's about.)
Reproduction
https://stackblitz.com/edit/tresjs-instanced-mesh-fklgmc?file=src%2Fcomponents%2FTheExperience.vue
Steps to reproduce
System Info