Lumberyard
Legacy Reference

Exporting a Level of Detail (LOD)

Level of detail (LOD) is a technique that increases performance and reduces draw calls by displaying progressively lower detailed objects the further they are from the camera. Generally, each LOD should have its vertices reduced 50% from the previous level and a reduction in the number of materials used. Lower LODs should also have multiple textures combined into one texture to further reduce draw calls.

Lumberyard supports up to six LODs per group node in 3ds Max. The LOD numbering is from 0 (highest level of detail) to 5 (lowest level of detail).

You can export the following LODs from 3ds Max to Lumberyard:

  • Static Mesh LODs

  • Material LODs

Static Mesh LODs

Use the following naming and setup to export Static Mesh LODs using the 3ds Max Lumberyard tool.

LOD Naming

LOD naming conventions are very important with respect to prefixes and suffixes. You must use the following naming conventions:

The highest LOD mesh (LOD 0) does not need a prefix.

$lod1_ through $lod5_ (prefix)

LOD Setup

You can create a basic or advanced LOD setup.

Basic LOD Setup – All LOD meshes with the appropriate prefix must be parented under the main render mesh (LOD0). Refer to the example below for assets that have no animated parts or for small assets that do not need to be split up for culling.

Advanced LOD Setup – When you have LOD subobject meshes, the same rule applies as the basic setup where the LOD meshes with the appropriate prefix must be parented under their respective main render mesh (LOD0). The LOD0 mesh for the subobjects should be parented under the main object LOD0 mesh. Refer to the example below for assets that have animated parts or that are large and need to be split into multiple objects that can be culled.

Material LODs

When you set up material LODs, you create submaterials and assign them to the appropriate LOD mesh.

For example, you might have a material group named Tree_Mats.

Within Tree_Mats, you set up five submaterials. The first three submaterials you assign to LOD0, which is the highest poly model. The other two submaterials you assign to the LOD1 mesh. This means that when LOD0 is active, it uses the first three submaterials you assigned to it. When LOD1 is active, it uses only the two submaterials you assigned to it.

Debugging LODs

Use the following console variables to debug LODs:

  • e_DebugDraw = 1 – Name of the used cgf, polycount, and the used LOD.

  • e_LodCompMaxSize = 6 – (default value) Lower values force the LODs to load sooner.

  • e_LodRatio = 40 – (default value) LOD distance ratio for objects. Lower values force LODs to load sooner.

  • r_Stats = 6 – Displays the drawcall count for each object instance in the scene. The numbers above each object are broken down into total DP, zpass, general, transparent, shadows, misc.