POLYMASON

Unity's LOD Group, from separate files

Part of LODs and billboards for low poly models

Unity's levels of detail live in one component, the LOD Group. It holds each level's renderers and the screen size at which each takes over. This guide builds one from separate model files, which is what most exports give you, and goes through the settings around it. It's the Unity half of LODs and billboards for low poly models. Billboard trees make the far level, tree colliders go on the same prefab, and the Godot article does the same job in Godot.

From files named for their level

If a single model file contains children named with the suffixes _LOD0, _LOD1, _LOD2 and so on, Unity's importer builds the LOD Group for you. The model's root gets the component, with a level per suffix. This is the FBX pipeline's convention, and it works for any format that carries a hierarchy. An OBJ export with three separate files doesn't qualify, so you build the group by hand, once, and save it as a prefab.

Building one by hand

  1. Create an empty GameObject and name it for the tree.
  2. Drag the LOD0, LOD1 and LOD2 models into the scene and make them children of it, at the same position and rotation, at zero.
  3. Select the parent and Add Component, LOD Group.
  4. The component shows a bar with LOD 0, LOD 1, LOD 2 and Culled. Click LOD 0 and, in the Renderers list below, add the LOD0 child's Mesh Renderer. Do the same for LOD 1 and LOD 2. You can also drag each model onto its level's box.
  5. Drag the parent into the Project window to make a prefab.

A level can hold several renderers. If a tree's trunk and foliage are separate meshes, add both to each level.

The thresholds

The boundaries between levels on the bar are screen relative transition heights. Each one is the fraction of the screen's height the model's bounds occupy when the level switches. Drag them, or type the value on each level. For a tree, reasonable starting values are LOD 0 down to 60 percent, LOD 1 down to 30, LOD 2 down to 10, then Culled. A prop that's small on screen most of the time wants its LOD 0 threshold higher, so it leaves the full mesh sooner.

The camera icon on the bar scrubs the Scene camera through the distances so you can see each swap. Unity measures screen size from the renderers' bounds, so if LOD1's bounds differ from LOD0's, the swap point moves between levels. Levels built from the same tree have the same bounds. Levels made by decimation may not.

Fade Mode

Fade Mode is the dropdown at the top of the component. None is a hard swap. Cross Fade dithers the outgoing level into the incoming one over a fraction of the level's screen height, which you set with Fade Transition Width on each level. It needs a shader that supports it, and Unity's Standard and URP Lit both do. Speed Tree is the cross-fade variant SpeedTree models use, with a smooth vertex transition, and it isn't meant for hand-built levels. Cross Fade with a width around 0.1 hides the pop on anything the player looks at directly.

Quality settings

LOD Bias, in Project Settings under Quality, scales every threshold. A bias of 2 keeps each level twice as far out, and 0.5 swaps sooner. Maximum LOD Level drops the highest levels entirely on low quality settings, so LOD 0 is never used on a low-end preset. Set these per quality level instead of tuning every group.

Batching and instancing

A LOD Group's renderers batch like any others. Static batching merges static renderers with the same material, and it works with LOD Groups because each level's mesh joins the batch for its material. GPU instancing, a checkbox on the material, draws all trees at the same level in one call. Neither needs anything from the LOD Group itself. They do need one material, and a palette texture gives you that.

Billboards as the last level

A billboard can follow the last mesh level. Add a quad with the tree's picture on a cutout material as another child, and make it the last level before Culled. The other way is a Billboard Renderer with a Billboard Asset. The billboard article makes both.

What PolyMason exports

The tree builder writes LOD0, LOD1 and LOD2 as separate OBJ files with the same bounds and the same palette, so building the group above takes three drags and a prefab. The zip's manifest lists the exact triangle count of each.

More in this guide

  • LODs and billboards for low poly modelsHow levels of detail work, what triangle counts are reasonable for low poly trees, rocks, buildings and characters, how to make the levels so the swap doesn't pop, billboards and impostors for the far distance, and the LOD setup in Unity, Godot and Unreal.
  • Billboard trees in Unity for the far distanceWhat a tree billboard is, how to make the picture, the two ways to show one in Unity (a quad with a cutout material, or a Billboard Renderer), how terrain trees do it for you, and the settings that keep it from looking flat.
  • Godot 4 LODs: mesh LODs and visibility rangesGodot 4 has two LOD systems, the automatic mesh LODs the importer generates and the visibility ranges you set on nodes. This covers how to control each, fading between levels, and how they work with MultiMesh for a forest.
  • Tree colliders in Unity: a capsule on the trunkWhy a tree's collider should be a capsule around the trunk with nothing around the canopy, how to set it up on a placed tree and on a terrain tree, what Generate Colliders on the importer gets wrong, and the same setup in Godot and Unreal.

Or build a tree and see what comes out.