- Home /
Problem with 2D Sprites and draw calls
Hi,
I have this issue with draw calls and 2D sprite I dont understand. I have to admit I am far from an expert on draw calls, but i still find what's going on strange.
In one scene I have 100+ sprites, and all in all my draw calls are 23, which seems pretty okay.
In another scene I have 50-ish sprites, and get 57 draw calls(!).
I have tried to figure out what I am doing or not doing in one scene, and what I am going in the other... but I cant find any real difference, and no reason why the draw calls are more than doubled, while the amount of actual sprites on the screen are less than half...
Can anyone shed some light on how draw calls and 2D sprites work? I have tried to google it of course, but havent managed to find much information at all.
Thanks in advance.
EDIT: I just noticed that setting scale to -1 on an object creates another draw call, which seems to be why I had so much more in one scene than the other. I had much more mirrored sprites there. So I guess my question now is: why does mirroring an object create another draw call?? Or is it a bug with the stats?? If a rotate the sprite 180 degrees instead of mirroring it doest not cost me another draw call...
Answer by DevinDazzlr · Aug 04, 2014 at 11:54 PM
You are correct, that setting the scale adds another draw call - at least, if you have the same sprite in the scene with a difference scale. That is expected behavior according to the docs: http://docs.unity3d.com/Manual/DrawCallBatching.html:
Generally, objects should be using the same transform scale. The exception is non-uniform scaled objects; if several objects all have different non-uniform scale then they can still be batched.
Your answer
Follow this Question
Related Questions
dynamic batching problem with spriterenderer 1 Answer
Dynamic setting of sprites cause many draw calls 0 Answers
Add to existing sprite sheet texture without messing up animations? 1 Answer
Shader Sprite/diffuse add shadow on spotlight 0 Answers
Replace a sprite by another in every game object using it 1 Answer