Search Unity

Batching a group of 3D Characters - Best Practices

Discussion in 'Editor & General Support' started by poolts, Apr 11, 2013.

  1. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    Say I have a model of a player (roughly 6k verts) what would be the best practice to dynamically batch a team of models? Which all share the same material and mesh setup (i.e. separate meshes, but the same instance).

    In the docs, our model falls under the 180 verts required criteria for dynamic batching, since it uses normal maps, and extra UVs.

    Breaking the model into smaller parts under 180 verts would take forever, and be a painfully slow pipeline. Any ideas how to batch a group of 3D characters and reduce draw calls?
     
  2. Glockenbeat

    Glockenbeat

    Joined:
    Apr 24, 2012
    Posts:
    669
    Along with the Standard Assets comes the MeshCombineUtility which basically allows you to create a single (skinned) mesh from many other meshes when gameplay starts. This is not very applicable to enemies which can move around because if you have enemies which are far away from the current FOV but only one of them is currently visible, all of them will be rendered.

    However if you have e.g. a group of static items the script works like a charm.
     
  3. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    I guess in this case then, dynamically batching a team of players would be a bad move, since if the camera culls any of them, the entire mesh will still be rendered. I.e. for a hockey team, if you can only see the forward the goal keeper's mesh would still be in memory.