- Home /
Combine Objects/Meshes to reduce drawCalls
Hi there,
We recently added tons of new models to our game. The result are FPS drops down to 5-10. I guess the combination of lots of models, each consisting of tons of models/meshes themselves, causes this drops
Is there a way to combine them, so that there are fewer drawCalls?
Edit: Here is an Example of one of the new Objects. It obviously consists of too much objects itself. How can I combine them?
thank you
let's say it like that. all these new models belong to one "unit". This unit does not have to be rendered all the time. But the moment it becomes visible, most of its components are visible, too.
Answer by TonyLi · Jul 01, 2013 at 02:21 PM
You can combine meshes: Mesh.CombineMeshes().
Or use a tool like Mesh Baker (or write your own) to combine meshes and make textures atlases if your models use multiple textures or materials. Lots of materials for a single model can really kill your framerate.
There are other good tips on the Modeling Characters for Optimal Performance page.
First be sure that there aren't any real problems, such as a script hanging up on a missing bone in your model or something like that.
first of all, thank you. But can I simply combine different meshes? I always thought I can only combine similar meshes.
There are some restrictions -- for example, meshes that move relative to one another can't be combined. But in those cases you can do a lot to improve dynamic draw call batching, as described in the Draw Call Batching page. Since these are moving characters, you should focus on dynamic batching like @Em3rgency suggested, rather than static batching. Also, for dynamic batching:
Combine materials using texture atlases
Under 900 vertices (see the page)
No multipass shaders or realtime shadows on your characters
If your characters can't meet the requirements above, the Shadowgun presentation on optimizing for mobile has more good tips even if you're not targeting mobile specifically: http://blogs.unity3d.com/2012/03/23/shadowgun-optimizing-for-mobile-sample-level/
static batching helped me to improve the performance from ~7 to 14fps. But when you look at my recently uploaded screenshot, you will see there are lots of objects. how do I combine them? Because I don't know which I can actually combine and which not.
In that case, are you using a texture atlas and one material? (Or maybe two, if you need a separate material for transparent windshields.)
How much are lights impacting your frame rate? Lights and shadows can really do a number on it. Lightmap, use light probes, and consider changing from dynamic shadows to something simpler but faster.
Answer by Em3rgency · Jul 01, 2013 at 11:33 AM
the problem is, that the batching works for objects that are alike. this is not the case for most of the objects.
Your answer
Follow this Question
Related Questions
FPS character, full body or just arms? 2 Answers
Android performance problem on model joints(Rig). 1 Answer
Many meshes with different color performance 1 Answer
What's the best way to optimise thousands of instances of the same mesh? 2 Answers
Occlusion culling and mesh combining possible and working? 0 Answers