- Home /
How to batch draw calls for imported FBX models
In my test case I duplicate 50 enemies in the scene. The enemy object is instantiated from an FXB model (imported from a .FXB file via FBXImporter). The FBX contains a single-material mesh model and one animation. All import settings are set to default.
I noticed,
50 enemies take 50 draw calls and they are not batched at all. When I clicked the material field in each enemy model in Hierarchy View they are all linked to the same material entry in the Project View and no "(Instance)" suffix to the material name. Does that mean they share the same material? If YES why they are not batched according to the discussion in "Optimizing Graphics Performance"?
When I choose "Don't Import" in the FBXImporter for [Animations], and instantiate 50 enemies again ... they are all batched to one draw call! Seems animation add something that stop unity from batching ... am I right?
I have successfully batch draw calls with simple geometry objects, such as, plane, box using share-material technique. But not working with FBX models. Can anyone give more information?
Heartly appreciate!
Answer by Dreamora · Dec 26, 2011 at 05:05 PM
You are right, anything with SkinnedMeshRenderer will never batch (enemies likely are animated and thus skinned renderers) Thats also mentioned in the documentation.
Your answer
Follow this Question
Related Questions
FBX importer at runtime(iOS) 0 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Resource slicing to reduce iOS app size 1 Answer
Textures over FBX not correctly applied 1 Answer
FBX mesh collider causing iOS to crash 2 Answers