Directly Remove InstancedMesh Instance?

Hey, so let’s say I have an InstancedMesh with a few hundred instances. I’d like to remove one of the instances. The only way I can think of removing it is finding it’s values in the instanceMatrix and removing them. Is this possible? Is there a better way?

No, that does not work.

The buffer size of an instanced mesh is fixed (so you can’t resize it). However, you can tell the renderer with the count property how many of the maximum number of instances should be rendered. So in some sense it’s like defining a draw range. You can check this feature out in this example: three.js webgl - instancing - dynamic

So one way to solve this issue is to “move” the instances you don’t want to render to the end of the instanced buffers and then decrease the count property.

2 Likes

Thanks, that should work!