- Home /
Question about draw calls and sprites
I'm trying to do some optimization for my mobile (Android) game, when I found that for some reason i'm getting absurd amounts of draw calls. I have an setup where objects move around the screen, leaving an trail of 'particle' gameobjects behind them (I prefer the control of the particles being gameobjects, don't judge :P ) Anyway, normally this wasn't an major sticking point, and had no real impact on performance during times like shown below:
For some reason however, as soon as I added an second particle to the player's shots, nearly every particle from those shots increases the number of draw calls! (If I only enable either player particles or enemy particles, then the number of them has almost no affect on the number of draw calls)
My instinct tells me it's something with the alpha blending and that having to deal with multiple sprites complicates things quite an bit, I could be completely wrong though. Anyone more experienced have insight on what's causing this, or what I can do to prevent it?
Edit: After an bit more research, I'm fairly convinced it's because all of the player particles and all of the enemy particles are batched together, so they're very efficient alone, but adding an second type of particle creates alpha interactions that make the rendering much more complex. Anyone know what I should do about this? (Apart from just less particles, obviously :P)
Answer by giulio-pierucci · Feb 07, 2015 at 11:05 AM
There are some limit of dynamic batching (do you use it in this case?), but none is about blending.
http://docs.unity3d.com/Manual/DrawCallBatching.html
Maybe is possible that you change material properties (i.e. material.color) on instancing? On runtime, renderer materials are linked to a single material or a material instance?
Your answer
![](https://koobas.hobune.stream/wayback/20220613182701im_/https://answers.unity.com/themes/thub/images/avi.jpg)