I have been reading about the great new 2d features in unity3d and there’s something I’m not sure about: I use unity3d indie for ios and android. This devices are limited related to draw calls. If unity does not pack the sprites I import into it (creates a sprite sheet from them), does this mean I will have a draw call per sprite if they are all imported as diferent textures?
You can pack those sprites into one in a painting software and then in Unity (in import settings) you can unpack them into single sprites by selecting Multiple in Sprite Mode (making it a texture atlas that is fully editable in a Sprite Editor window). That means if you have all of them on screen it costs you only 1 draw call.
Not true, it will render every single sprite sprite, even if it is the same one, with a drawcall. This is so bad that the default tutorial wouldn’t even run well on my tablet as it has over 30 drawcalls.
So unless this is a bug, it seems that the 2D system is mostly useless on mobile (unless you buy $4500 worth of software).
I have the same amount of drawcalls whenever I add another part of my sprite on the screen (by sprite I mean one part of the big texture atlas sprite, each one is an object with a Sprite renderer attached).
When I tested it out it seemed to work OK for me (not on pro). But I haven’t tested in Build.
I used a texture with import settings Sprite - Multiple,making two texture “slices” in the Sprite Editor. I created two sprite game objects, each using a different texture (slice).
Stats when playing:
Draw Calls 1, Saved by batching: 1
Do you have Sprite Packer enabled in Editor Settings?
Wait, from what I understand, the Sprite Packer is a Pro Only Preview, so it will be available for Unity Free too. In the future.
Here it says: …with one exception, all our new 2D features are currently available in the free version of Unity
And then: - Save on textures with automatic atlas generation (Pro preview) - Optimize your fillrate with alpha cutout (Pro only)
No, even with sprite packing disabled it automatically combines sprites using the same texture. I can see this by making a sprite, duplicating it a few times, and the “saved by batching” number in the stats goes up while the draw calls remain at 1.
Looks like batching breaks if the object has a collider on it.
Plain sprites do indeed batch just fine, wether it’s the exact same sprite or just atlassed. Put a collider on it? Every sprite now has it’s own drawcall.
EDIT: My problems are indeed due to a bug, but it’s not the collider. I have absolutely no idea what is triggering it and I cannot replicate it in a new scene.
I’m having this problem of multiple draw call when using the same atlas and material.
I suppose this is a problem related to the animator.
I’ve made a few copies of a character with the new 2d animation system, changing sprites + moving, scaling, rotating them. (My character is composed by a series of sprites, something like the tutorial but with more hierarchy inside the character)
Each copy is giving me 8 draw calls, although all sprites are at the same texture.
I solved this issue, it was not related to the animator.
My problem was I was using an -1 scaled sprite for the arms. I’ve researched and saw that this change in scale breaks the batcher.
I’ll leave both posts here if someone gets the same problem already know something to start with =)