Paint with Thin Instance probleme

Hello

I tried to use Thin Instance, but then I have some problem retrieving the position of all instances. And it cannot be deleted with dispose.

Is there a way to recover the location and delete them?

On this PG, it is the conversion with thin instances (with error in the console If we try to paint)
https://www.babylonjs-playground.com/#DJQYJW#24

Here is the PG with normal instances and it works
https://www.babylonjs-playground.com/#DJQYJW#25

3 Likes

Adding @Evgeni_Popov to this thread as he rocks thinInstance :wink:

Up @Evgeni_Popov

Sorry, I missed this one.

There’s no delete in thin instance, it’s up to you to manage the number of thin instances by modifying the matrix buffer / the thinInstanceCount property.

Thin instances are meant to be fast and mostly static, so more work are required on user side if you want to use dynamic thin instances.

Have a look to the “Faster thin instances” section of this doc: Use Thin Instances - Babylon.js Documentation

You should create a big enough buffer for your need and manage the number of instances to display with thinInstanceCount.

Ok, so for my use case this is not the right solution. I will therefore keep the solution of my second PG.

I think I would find the occasions to use them elsewhere, because they are cool “instances”.

Thanks

1 Like