Render 250000 sphere in a Unity Scene?

I have a csv file which has position and rotation value and it contains 250000 rows. I need to generate a sphere's using this CSV file data for each position. I tried using Instantiating and it is taking a toll on my computer and also the Unity. The Unity crashes each time I try to load. So, my question is what is the best possible to way to render this 250000 sphere in the Unity which having problem with the performance? Any tutorials or resource that is helpful.

Use either DOTS or DrawMeshInstanced.

1 Like

Why spheres? Can you get by with faking it with a billboard? Any normal projection of a sphere will result in a circle, so do you really need the depth? I suspect that you don’t need the back face, you aren’t casting or receiving shadows, so you don’t really need the geometry. If you want to light it, you can fake that too with a normal map.

1 Like


Use DrawMeshInstanced or maybe mesh-based particle systems.

1 Like

Good answers for Dots and drawMeshInstantiated/indirect.
Or create one, or multiple big meshes, consisting these small meshes, if they don't move.

1 Like

Could try and tick on "Enable GPU Instance" on the material and see if that works. Seems like that would be the first 'test' to try.

While probably not the best as it's a general use thing, so the above answers will definitely give you better performance without a doubt. But if this works and is what you need, just saved you a lot of time. lol

1 Like