Instantiating Models to Scene & Performance

Hello, just wanted to ask what is the best practise performance wise to instantiate meshes to the scene in real time?

In my case I have pre loaded some GLB meshes and I have to keep adding them to the scene when the player is close to them with AssetContainer.instantiateModelsToScene

I don’t create instances, as that seems to slow it even more.

The objects are added to the scene asynchronously, not all at once.

I still get spikes though. Disabling shadows kinda makes it better.
I did most of the performance optimizations suggested.
We are talking about 100-200 active meshes at any given time in the screen + terrain.

QUESTION:

  • Is there a better way to handle adding models to the scene?
  • Is it possible to use a Worker thread + offscreen canvas to load models?

Hello! This will be a bit hard to say without looking at your code, so if you could provide a Playground that would be immensely helpful :slight_smile: