blog games developers documentation portfolio gallery


Merging meshes

As an example I used a propeller aircraft that is included in the free Unity package called "Sample Assets". As you can see it is made up of a lot of child objects, each with their own mesh renderer and their own materials. In total it has 26 meshes with 58 materials.

To merge those meshes together all you need to do is select the top level object and select Tools->Simple LOD from the Unity menu.
Menu item Tools - SimpleLOD.

This will open up a panel.
Make sure it says "GameObject: Propeller plane".
Click on the first button called "Merge child meshes".
SimpleLOD popup panel.

After one or 2 seconds you get a message saying it is done. It also tells you the location of the new mesh asset in the project folder and the number of vertices and triangles in the new mesh.
Merge meshes ready.

When you look at your game object in the inspector you now see that there is 1 new mesh called Propeller plane and it has 12 sub meshes. One for every unique material that was found in the children. The child objects are all disabled and if you want you can delete them. So instead of 58 calls to the graphics card we now have only 12.
Merged mesh inspector.

There should not be any visible changes between the original and the new mesh.
Merged mesh result.

Merge again

If you want to re-run the merge operation, you have to undo everything by revert to the backup copy that was made by SimpleLOD.
You can also undo everything by hand:
1. Remove the mesh renderer that holds the merged mesh,
or if there was already a mesh renderer in the original object at this level, change the mesh back to the original
2. Activate the child objects that need to be merged
3. Click the "Merge child meshes" button again.

follow us