blog games developers documentation portfolio gallery

Documentation:

Step by step

The process of making an object LOD ready is made up of 4 parts:
- Merging meshes together to reduce draw calls
- Merging materials and baking atlases to further reduce draw calls
- Reducing triangles

Before you start


When you open the SimpleLOD window, a backup copy of your game object is made. You can always fallback on this copy when you click the "Revert" button. But before you start molesting your game object by merging, baking and decimating, make sure this backup copy is the latest version of your game object by clicking the Backup button next to it. (otherwise you may be using a backup copy that was initially made during the 1st SimpleLOD session weeks ago). Read the Caveats page!!!

Step 1: Merge meshes


Merging meshes can be done with the Unity function Mesh.CombineMeshes(). But uhm...that function is mostly useless. Sorry, but I can't put it any other way. When you combine meshes that already have sub meshes, those sub meshes are swallowed up in 1 sub mesh. And it also doesn't deal with skinned meshes. Therefor Simple LOD has it's own merge function. It merges all sub meshes and all child objects into 1 big mesh with sub meshes per shared material. And it can even handle skinned meshes.

You can either choose to merge into an empty parent object or directly into the mesh of the topmost gameobject. The first method would be the best way to do it. Just create an empty gameObject and make everything you want to merge together a child of that gameobject. Then open SimpleLOD and click "Merge child meshes".

Disable any child objects that you do not want to be included in the merged mesh before you perform the merge. Those objects will be skipped. You can enabled them again afterwards.
Centaur with multiple skinned meshes and non-skinned meshes.

Centaur with multiple skinned meshes and non-skinned meshes



Step 2: Make atlases


Open the materials and atlases window by clicking "Show atlas window". This window will show you all materials that remain in a table. Simply drag the materials (rows) that you want to combine onto eachother to merge them. You will see that the textures are combined into an atlas.

You can only drag rows that have textures and you also need to make sure the textures have the "read/write enabled" switch on in their import settings. By clicking the "Make readable" button this will be done for you by SimpleLOD.

Although you only see the atlas of the main texture, similar atlases are made for all other textures that are used like normal maps and specular maps.

When you do not want to combine the materials, but do want to make atlases, you only drag the right column with the atlases and not the entire row.

To separate two materials you drag the materials away from eachother.

The max size of the atlas can be changed with the listbox nest to the top-most material that uses the atlas. The individual textures can be scaled inside the atlas by using the 1:1, 1:2 etc listboxes.

When you are done, you click "Apply" and the atlas textures are saved, the mesh uv coordinates are changed and the materials are created.

There is a Revert button at the bottom of the window. if you dont like the result. This will revert the material changes, but not previously execute merge of the meshes. Alternatively you can use the revert button of the SimpleLOD parent window to revert the entire gameobject back to the original state.
Drag & drop materials to bake atlases.

Drag & drop materials to bake atlases



Step 3: Create LOD levels


Next you generate LOD meshes. This step will take a while (varying from a few seconds to as much as 5 minutes), but it is well worth it. Using the alternative 3a will add an LODSwitcher component to your gameobject.

Inspect the results in the editor by dragging the LOD slider of the LODSwitcher component. To inspect the LOD level from the distance that it would be seen in the game, check the toggle switch "Move Camera with LOD".

You can repeat this step as often as you like.

It is also possible to use the alternative 3b. In this case a gameobject is created for each LOD level and activated/deactivated by the LOD Switcher component

Using alternative 3C will also create a gamobjects per LOD level and add an parent LODGroup object. This uses the default Unity LODGroup component instead of LODSwitcher.







follow us