Hi everyone,
This is my first post here, so hopefully I chose the correct topic.
The issue/problem I have is the following:
I’ve setup a scene, so that I have about 190 Sprites and about 150 Animated Sprites displayed using a perspective camera. They interlace each other and are composed so that basically they look like a town on a diamond-shaped grid.
All the 190 Sprites use the same TextureAtlas and then all the 150 Animated Sprites also use another TextureAtlas. I turned on dynamic batching (I’ve also tried tests with static batching but nothing really changes).
Now I try to run this on an iPhone 4S and I get about 45 FPS when I’m zoomed out and see all the assets (the whole town), on a Galaxy S3 I get about 50 FPS.
This means I get about 150 Draw Calls because the sprites are on top of each other (when I remove either the animated or non-animated sprites, so that all the sprites come from the same texture I get 3-5 Draw Calls). In a real game scenario, I would probably have even more texture atlasses as I can’t squeeze everything into 1 or 2, therefore the Draw Calls would go up even further.
When profiling in Xcode, the CPU takes always around 22ms and the GPU only 2ms. I’ve read that issuing a draw call is a CPU job - therefore no wonder where the high CPU time comes from.
For the exact same setup (in fact a bit more complex, as it has more atlasses and even more sprites) I can easily get 60 FPS without dropping on both devices, when I use Cocos2D with a native approach.
This isn’t yet a show stopper, but once I start adding 3D objects into the scene, the frames drop even up to 25 FPS on the 4S (35 FPS on Galaxy S3) and this starts to be really noticeable.
Maybe I’m not using some special hidden functions (even though I scoured the web a lot and read a lot about pushing this setup to the limit), but I think I’ve now hit the wall with what I can do in 2D with Unity. And this seems to be about 150 non-animated sprites and 150 animated sprites.
Is it possible that I’m missing something, or is it that Unity can truly only cope with this many sprites when deployed to mobile devices?
Background:
I work for a company that is looking to combine 2D + 3D graphics in a mobile game (iOS + Android). We would like to move from the native approach to something better suited to deploying for the two platforms simultaneously.
I can of course provide more technical details about the setup or anything else if this helps ![]()
Thank you for your attention!