Level of Detail (Pro Only)

As your scenes get larger, performance becomes a bigger consideration. One of the ways to manage this is to have meshes with different levels of detail depending on how far the camera is from the object. This is called Level of Detail (abbreviated as LOD).

Here's one of the ways to set up an object with different LODs.

  1. Create an empty Game Object in the scene
  2. Create 2 versions of the mesh, a high-res mesh (for L0D:0, when camera is the closest), and a low-res mesh (for L0D:1, when camera is further away)
  3. Add a LODGroup component to this object (Component->Rendering->LOD Group)
  4. Drag in the object with the high-res mesh onto the first Renderers box for L0D:0. Say yes to the "Reparent game objects?" dialog
  5. Drag in the object with the low-res mesh onto the first Renderers box for LOD:1. Say yes to the "Reparent game objects?" dialog
  6. Right Click on LOD:2 and remove it.

At this point the empty object should contain both versions of the mesh and "know" which mesh to show depending on how far away the camera is.

You can preview the effect of this by dragging the camera icon left and right in the window for the LODGroup component.

camera at LOD 0
camera at LOD 1

In the Scene View, you should be able to see

LOD-based naming conventions in the asset import pipeline

In order to simplify setup of LODs, Unity has a naming convention for models that are being imported.

Simply create your meshes in your modelling tool with names ending with _LOD0, _LOD1, _LOD2, etc., and the LOD group with appropriate settings will be created for you.

Note that the convention assumes that the LOD 0 is the highest resolution model.

Setting up LODs for different platforms

You can tweak your LOD settings for each platform in Quality Settings, in particular the properties of LOD bias and Maximum LOD Level.

Utilities

Here are some options that help you work with LODs

Recalculate BoundsIf there is new geometry added to the LODGroup that is not reflected in the bounding volume then click this to update the bounds. One example where this is needed is when one of the geometries is part of a prefab, and new geometry is added to that prefab. Geometry added directly to the LODGroup will automatically update the bounds.
Update LightmapsUpdates the Scale in Lightmap property in the lightmaps based on the LOD level boundaries.
Upload to ImporterUploads the LOD level boundaries to the importer.

Page last updated: 2012-02-01