I will have at lease 100000 2d sprite on the screen. When the camera big enough to see them, I find the game is so slow.
For The 100000 sprites are also very small, but the drawcall is still big. and how can I do?
I think the camera must render one single sprite to be just a pixel . but seems upset
Well 100,000 is a lot of objects, no matter what. In order to get that to batch to, say, less than even 50 drawcalls, you’d need 2000 objects in each batch, which I think is unlikely to happen. Also not just the batching/drawcalls, but the sheer overhead of processing 100,000 objects… dealing with all those transforms, generating the geometry, pushing it to the gpu etc… you might not notice it with 5000 objects but at 100,000 it adds up.
Are all the sprites static ie they don’t move, or are they like tiles in a grid, or are they all dynamic?
Well Unity sprites already get batched and use a spritesheet. You do have one spritesheet texture that is shared by all of the tiles, right, not like 100 different textures?
If it is 100,000 objects making up one huge object the individual objects must either be tiny or all not onscreen simultaneously.
If tiny like a few pixels or less you could simply make larger objects. Say you represent whatever with 6,250 4x4 pixel objects instead of 100,000 1-pixel objects. The player destroys the 4x4 objects which breaks off and then you can shatter that piece down into 16 1-pixel bits.
If the object is massive and not all on-screen then deactivating any objects that are off-screen should speed things up.
Thx GarBenjamin :), thx for your suggestion , your solution maybe the only solution ,I cannot control the camera how to render the sprite, can I? what I can do is only to combine , but It will need a lot of work for too many logic in on the 2d sprite
I must have missed the bit about needing to zoom out. Really don’t know what is being made. With it being sprites I figured it was 2D and there would be no zooming.
I can zoom the camera and rotation the 2d object in the camera, the 2d object have six different faces with their own collider, single 2d object is one tile