I am instantiating around 100-120k particles (as prefab Gameobject spheres) at positions read in from external data. They all then move independently of each other based on their updated positions in the data. The problem is, 100k spheres = 100k draw calls, and I’m unsure how to reduce this number other than to draw a single mesh for all of them, which seems difficult because of the nature of their movement and instantiation. The spheres have standard shaders and use 1-2 materials max (one for each star in our simulation). Thanks for any help in advance.
@pricem I believe part of the problem is that Unity’s default spheres consist of 512 vertices, and this is usually too much for dynamic batching to work (depending on shader complexity).
As can be read in this link of @Asgardr :
Batching dynamic GameObjects has
certain overhead per vertex, so
batching is applied only to Meshes
containing fewer than 900 vertex
attributes in total. If your Shader is
using Vertex Position, Normal and
single UV, then you can batch up to
300 verts, while if your Shader is
using Vertex Position, Normal, UV0,
UV1 and Tangent, then only 180 verts.
I’ve avoided this by simply switching the default spheres with custom sphere meshes with around 100-200 verts, thus making dynamic batching work. If you have 100k objects, the spheres’ details are probably not visible anyway. Or if some of them get close to the camera, a LOD group should work.