What is level of detail (LOD)?
Level of detail (LOD) is a 3D rendering technique that swaps in simpler versions of a model as it takes up less of the screen, reducing geometric complexity and, depending on how the assets are authored, materials or draw calls while keeping the visual difference hard to notice.
Games, VR experiences, and other real-time 3D applications use LOD to maintain a steady frame rate in scenes with thousands of objects.
How does level of detail work?
Level of detail works by preparing several versions of the same object, each with less detail than the last, and selecting the appropriate version based on how large the object appears on screen. Unity and most other engines number these versions LOD0, LOD1, LOD2, and so on, with LOD0 as the most detailed.
The triangle count generally decreases with each LOD level.
Switching between levels can cause a visible pop. Cross-fading blends the outgoing and incoming levels for a short time so the change is harder to see.
What are the types of level of detail?
Level of detail comes in several forms, and many projects combine these techniques:
- Discrete LOD: The engine switches between a fixed set of pre-built meshes with different levels of detail. This is a common approach in games.
- Continuous LOD: The mesh is simplified or refined gradually as its screen-space size changes, rather than switching at fixed LOD levels.
- Hierarchical LOD (HLOD): Groups of distant objects are combined into a simplified representation, reducing draw calls and geometric complexity.
- Texture LOD (mipmapping): The GPU samples progressively smaller, pre-filtered versions of a texture as surfaces appear farther away or occupy less screen space.
- Billboards and impostors: A distant 3D model is replaced with a simplified representation, often a flat image that faces the camera.
Level of detail and Unity
Unity provides multiple ways to implement level of detail, including Mesh LOD and the LOD Group component. Mesh LOD can generate LODs during asset import and is designed to reduce geometry and GPU vertex processing with minimal additional memory. LOD Group lets you configure separate LOD levels and switch between them based on screen size.
What's the difference between LOD and culling?
Level of detail and culling both reduce rendering work, but they act on objects in different ways:
Most real-time projects can use all three together. Culling removes objects that don't need to be rendered, while LOD simplifies objects that remain visible.
What are the benefits of using level of detail?
- Higher frame rates: Rendering fewer triangles for distant objects reduces GPU workload, which can help a project maintain its target frame rate.
- Larger, denser scenes: Open worlds, forests, and city scenes can show far more objects at once.
- Scalable performance: LOD can help the same content scale across platforms with different performance capabilities, including mobile devices and standalone VR headsets.
What are the challenges of using level of detail?
- Visible popping: A sudden switch between levels can be noticeable unless transitions are cross-faded or thresholds are tuned.
- Extra memory and storage: Each additional LOD mesh can add mesh data, increasing memory usage and potentially build size.
- Authoring time: Hand-made levels take artist time, and automatically generated levels still need checking for visual artifacts.
Frequently asked questions (FAQ)
How many LOD levels should a model have?
There is no fixed number of LOD levels for every model. The right number depends on the object's screen size, viewing distance, visual complexity, platform, and performance target. Additional levels can provide more gradual changes in detail, but they also require additional authoring or processing. Unity's mobile art optimization tips suggest reducing triangle counts by about half between LOD levels.
Does level of detail apply to textures as well as meshes?
Yes. Mipmapping is a texture level-of-detail technique in which the GPU samples smaller, pre-filtered copies of a texture as surfaces appear farther away or occupy less screen space. This can reduce texture memory bandwidth and visual artifacts such as shimmering. Mesh LOD can also use different materials or shaders at lower levels, depending on how the LODs are authored.