- Home /
Reducing draw calls vs culling
Hello folks,
I've been involved in making my first game, an FPS, for the iPad. We recently added the terrain for the first level and the performance was not so good. In looking at all the ways to optimize there are two somewhat conflicting techniques that come up very often; combine meshes with identical materials to reduce draw calls, and set your scenes up to take advantage of occlusion culling. The latter suggests breaking things up. There is likely a good balance between the two and automatic batching is in the equation as well. On the extremes you either put every triangle into separate game objects to take maximum advantage of culling. On the other end, you put everything into one game object to reduce draws. It seems apparent that occlusion culling is more important than reducing draw calls up to a point. Does anyone have any advice on how to balance these two technique to maximize performance? Does auto batching mean I can really just concentrate on culling?
Answer by pyro · Dec 06, 2010 at 03:23 PM
No you can't just concentrate on culling, in fact culling is pretty much transparent. You just run Umbra and let it decide what to cull based off the view areas you defined. All culling is doing is turning off objects that the camera shouldn't be seeing anyway.
Batching, on the other hand, is one of the main things you need to be worrying about as a Unity iDeveloper. Auto-batching only kicks in for small objects, so it's great for little environment pieces. Static batching is great for larger objects with more vertices, but can only be used for objects that don't move.
The main thing is that batching needs small objects that share the same material, and occlusion culling needs small objects to better determine if it is off-camera and should be culled or not. So as long as you are creating assets that fit the dynamic batching criteria, they will automatically be optimized for culling too.
Use both.
I understand how culling works and you can indeed concentrate on it by designing your object sizes appropriately in the global world. If I create my entire landscape in one mesh then it will like not be culled correctly. However, there is a lot of info out there that tells me to combine meshes, which appears to no longer be very valid in a lot of instances, especially for static objects that meet the criteria for batching.
Yes combining objects is one way of reducing draw calls, but should only be used on groups of objects that will likely all be on the camera at one time. There is a good video on Autodesk's website that explains alot http://area.autodesk.com/gdc/ondemand9
Your answer
Follow this Question
Related Questions
HUD with a lot of elements, efficient way? 3 Answers
Batching on moving objects[Solved] 1 Answer
Does Unity Do "Portals"? (Not the Valve Game) 1 Answer
What is the fastest way at runtime? instantiate? moving in/out camera? activate/deactivate? 1 Answer
Small Vert/Tris count still generating more draw calls than expected 1 Answer