Skip to Content

Level of Detail (LOD) System for Unity

Overview

Now Unity have built-in Level of Detail feature!

LOD System for Unity.
version 1.0 beta.

figure1

This editor script is more like creating series of meshes like mipmap genereration algorithm.  It is old fashion way reducing polygons, but since it is not hardware dependent approach, this algorithm works on any platforms and still many games use this kind of approarch.

This will create mesh that has reduced tris, vertices, normals and uv (less detailed mesh).  No 3D application required just Unity is all you need to create lod mesh.

 I've looked at UniLOD script, but they didn't have feature 'Simplify Mesh' algorithm for Unity Indie  Mac version.  So here it is, I made this script for all users using Unity Indie or Pro Mac/Win.  This will let you make series of mesh that has less tris and verts and probably uv, normals, tangents also.  You can see the reduced mesh as a result at runtime.  If you like a result you can save it as lod mesh.  And also you can tweak which lod mesh should be used at certain distance as well.

 

How to install

1. download LODSystem.zip.

2. Extract ZIP file.

3. Copy 'LODSystem' folder to your project directory.
    It will look like figure below.

 

General usage

1. Select a GameObject you like to simplify.

2. Select 'LOD System' -> 'Simplify Mesh' from the main menu.

3. Then press 'Calculate'.  The script will precalculates for simplified mesh.  

 figure2

4. Once calculated you can do 'Preview' and see the change whiile dragging 'Collapse Ratio' slider.

5. If you liked the result you can 'Save As New Asset'.  The new asset will be created in 'Output' folder in 'LODSystem' folder.

 

Limitations

  • Currently tangents are not calculated. (ONLY normals and uv are calculated)
  • Advanced mode is disabled.
  • Can not assign shader or material to specific lod mesh.
  • 65535 vertices max for one model.
  • Models do not share lod mesh. (means each model has lod meshes itself)
  • Doesn't calculate mesh that has submesh. (I haven't tested yet. Error may occur)

Work with other scripts

 Since this script is beta It is better using other lod script for switching meshes.  And there are number of exporting mesh scripts you can find at Unify Wiki.  So use this script for ONLY for reducing polygons.

ToDo

  • LOD Manager for sharing lod mesh across models which instantiated from same mesh.
  • Dynamic lod mesh algorithm should be able to added. (Need to test if it can work with low cpu cost with low memory.)
  • More precise controls for lod mesh. (Shader, Materials, tangents, bone weights etc.)
  • Faster calculation time.
  • Low CPU cost and much less memory usage algorithm.
  • iPhone version should be added. 

 

Download

For Unity 2.6.1      For Unity 3.x 

 

Pleaes donate for supporting this project.  Thanks.

 

Acknowledgements

Unity Game Development Tool
http://www.unity3d.com/

Progressive Mesh type Polygon Reduction Algorithm
by Stan Melax (c) 1998
http://www.melax.com/polychop/

Polygon Reduction Script for Cheetah3D
by tg_jp
http://www.tres-graficos.jp/blog/files/article.php?id=24

UniLOD
by BearishSun
http://forum.unity3d.com/

Unify wiki
http://www.unifycommunity.com/wiki/