Optimization of a scene with a large number of meshes

Hello!
There was a need to optimize the project.
There can be more than 20,000 meshes on the scene.
There were no problems with optimization.
Articles by Max Marschall and Joe Pavitt helped.

The problem is that I need to be able to interact with every object on the scene. Change the position, materials.
But when optimizing, I combine objects. And the opportunity to interact with everyone disappears.

I have an idea, when interacting with an object consisting of several meshes, again making them separate, and after the interaction to combine again.
What is the right thing to do in this situation?

Created a prototype, with hover implementation.
Click

Thin Instances is pickable.
Docs:

Playground demo from docs:

Also, Octrees could possibly help if most of the meshes are static.

2 Likes

Yep thin instances are a great tool for optimization. You can also customize every single instance by using custom attributes and a custom shader/NME material.

1 Like

Thanks for the answer, I didn’t know about the existence of thin instances! :+1:

1 Like