LODs & Triangle Budgets
A character that fills the screen needs thousands of triangles; the same character 80 metres away covers a few dozen pixels and needs a few hundred. Levels of detail (LODs) are simpler versions of a mesh that the engine swaps in as the object gets smaller on screen. This lesson shows how to plan them with numbers instead of guesses.
How engines choose a LOD
Engines don't usually switch on distance directly. They estimate the object's screen size (how much of the screen height its bounds cover) and pick the LOD whose threshold it is above:
| Engine | Where | Threshold |
|---|---|---|
| Unity | LOD Group component | percentage of screen height per LOD |
| Unreal | Static Mesh editor, LOD Settings | Screen Size per LOD (or auto-generated LODs); Nanite meshes don't use classic LODs |
| Godot 4 | automatic mesh LOD generated on import, plus visibility ranges (HLOD) on nodes | distance ranges / lod_bias |
Screen size falls off with distance, so you can predict when each LOD appears:
import math
def screen_fraction(height_m, distance_m, vfov_deg=60.0):
"""fraction of the screen height covered by an object of this height"""
visible = 2 * distance_m * math.tan(math.radians(vfov_deg) / 2)
return height_m / visible
lod_thresholds = [(0.50, "LOD0"), (0.25, "LOD1"), (0.10, "LOD2"), (0.03, "LOD3")]
def pick_lod(fraction):
for limit, name in lod_thresholds:
if fraction >= limit:
return name
return "culled"
for d in [2, 4, 8, 16, 40, 100]:
f = screen_fraction(1.8, d)
print(f"{d:4} m: covers {f * 100:5.1f}% of screen height -> {pick_lod(f)}") 2 m: covers 77.9% of screen height -> LOD0
4 m: covers 39.0% of screen height -> LOD1
8 m: covers 19.5% of screen height -> LOD2
16 m: covers 9.7% of screen height -> LOD3
40 m: covers 3.9% of screen height -> LOD3
100 m: covers 1.6% of screen height -> culled
The triangle-budget calculator
Budgets are per frame: how many triangles the whole visible scene may draw. The point of LODs is that the average cost per object is far below its LOD0 cost. Given a crowd of objects at various distances, compute the frame total with and without LODs:
import math
def screen_fraction(height_m, distance_m, vfov_deg=60.0):
return height_m / (2 * distance_m * math.tan(math.radians(vfov_deg) / 2))
lods = [(0.50, 24_000), (0.25, 9_000), (0.10, 3_000), (0.03, 800)] # (threshold, triangles)
def tris_for(fraction):
for limit, tris in lods:
if fraction >= limit:
return tris
return 0 # culled
# 60 characters spread from 3 m to 120 m away
distances = [3 + i * 2 for i in range(60)]
with_lods = sum(tris_for(screen_fraction(1.8, d)) for d in distances)
without = 24_000 * len(distances)
budget = 1_500_000
print(f"without LODs: {without:>9,} triangles")
print(f"with LODs : {with_lods:>9,} triangles")
print(f"saving : {100 * (1 - with_lods / without):.1f}%")
print(f"share of a {budget:,}-triangle frame budget: {with_lods / budget:.1%}")without LODs: 1,440,000 triangles
with LODs : 62,400 triangles
saving : 95.7%
share of a 1,500,000-triangle frame budget: 4.2%
With these thresholds only the nearest few characters use LOD0 or LOD1, most of the crowd uses LOD2 or LOD3, the farthest are culled, and the crowd costs a fraction of what 60 hero meshes would. Each LOD step usually keeps roughly a quarter to a half of the previous level's triangles; a quick check that your chain follows it:
chain = {"LOD0": 24_000, "LOD1": 9_000, "LOD2": 3_000, "LOD3": 800}
names = list(chain)
for prev, cur in zip(names, names[1:]):
ratio = chain[cur] / chain[prev]
note = "ok" if 0.25 <= ratio <= 0.6 else "check: step too small or too big"
print(f"{prev} -> {cur}: {ratio:.0%} of previous {note}")LOD0 -> LOD1: 38% of previous ok
LOD1 -> LOD2: 33% of previous ok
LOD2 -> LOD3: 27% of previous ok
What a "triangle budget" really means
Triangles are only one cost. A frame also pays per draw call (each mesh × material is usually one), per vertex (skinning, vertex shaders), per pixel (overdraw, shader complexity) and for memory. Treat the triangle budget as a sanity check, and confirm with the profiler on the target hardware. Typical rough orders of magnitude for a whole frame: a few hundred thousand triangles on low-end mobile, a few million on current consoles and PCs; budgets for your game come from profiling, not from a table.
Making LODs
- By hand in Blender (Decimate modifier, or a modeller's retopology) for hero assets where silhouette matters.
- Automatically on import: Unreal's LOD Settings → Number of LODs with reduction settings, Godot 4's automatic LOD generation (on by default for imported meshes), and Unity 6.2+'s Generate Mesh LODs option in the model importer.
- By naming: export meshes named
Rock_LOD0,Rock_LOD1, … in one file and Unity's importer builds a LOD Group from them; Unreal can import LODs from an FBX LOD group as well. - Command-line tools for glTF such as
gltfpack(meshoptimizer) andgltf-transform simplify(see Toolkit: Asset & Audio Tools). - Impostors / billboards for the last LOD of trees and props: a flat card with a rendered picture.
LOD transitions can "pop". Cross-fading (Unity's Fade Mode, Unreal's dithered LOD transition on materials) hides it at a small cost.
Test yourself
How do Unity's LOD Group and Unreal's static mesh LODs usually decide which LOD to show?
- Exact distance in metres
- The object's size on screen
- The frame rate
- The triangle count of the scene
What is a typical triangle reduction from one LOD to the next?
- About 5% fewer
- Roughly half to three quarters fewer
- About 99% fewer
- None, LODs change materials only
Why is a triangle budget alone not enough to guarantee performance?
- Triangles are free on modern GPUs
- Draw calls, vertex work, pixel cost and memory also matter, so you must profile
- Budgets are only for mobile
- LODs make budgets unnecessary