- Home /
How to Reduce draw calls in unity3d
I want to reduce large numbers of draw calls for my android game. it hangs in playing and making performance issue. :(
You can have a huge texture that includes the textures you need for several objects, then they can share material and be batched by the engine which reduces drawcalls.
Take a look at this :
http://docs.unity3d.com/$$anonymous$$anual/DrawCallBatching.html
And read up on this as well, a different subject that may prove equally helpful to you :
http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/object-pooling
(Edit : and also read this :
http://docs.unity3d.com/$$anonymous$$anual/OptimizingGraphicsPerformance.html )
Hope this helps.
PS : I can recommend "Texture Packer Pro Standalone" and "TP Pro Unity Extension" by Stan's assets for the Texture Atlasing.
@wisearn - while texture atlasing is generally "a good thing", huge textures on mobile certainly are not. $$anonymous$$any mobile devices can't handle textures > 2048x2048px (some not more than 1024x1024) and even if they can theoretically handle it, it requires a large memory allocation. See here for a table.
@$$anonymous$$oliCat - what makes you think that it's draw calls that are making your game slow?
can you describe your game more detailed ? 2D or 3D ? And how many draw calls in your game now ?
Answer by faraz · Oct 18, 2014 at 08:42 AM
You can reduce draw call by implementing these things
batching dynamic and static Texture atlases,
Occlusion culling
lightmaping
mobile friendly shaders
low poly objects
low number of particles
unity already defined what to do for mobile performance http://docs.unity3d.com/Manual/OptimizingGraphicsPerformance.html
and by my experience i also used free unity plugin called Draw call minimizer and in give video they show how they reduced draw calls from 69 to 12.
Proper Occlusion culling is pro only, but depending upon the type/design of the game you are making you can sometimes use layer cull distance to simulate it. This method is never as effective as the real occlusion culling but I have managed to reduce my rendering overhead by roughly a third in the past using it.
using 1 material for all objects and also 1 mobile friendly shader can also help in good way.
Answer by Tanshaydar · Oct 17, 2014 at 01:21 PM
The answer to this question pretty much sums up most things. A simple search would've unveil it :)
http://answers.unity3d.com/questions/14578/whats-the-best-way-to-reduce-draw-calls.html
I, too, suffered from draw calls, reaching 4-5K for my PC title. A little experience, some testing, profiling, and trying things at runtime pretty much leads you to the source of the problem.