Levels of detail in Godot 4
Part of LODs and billboards for low poly models
Godot 4 has two ways to do levels of detail, and most projects use both without noticing. The importer makes simplified versions of every mesh and the engine swaps between them on its own; and any node can be given a distance range over which it is visible, which is how you use levels you made yourself. This is the Godot half of LODs and billboards for low poly models; the Unity half is the LOD Group, the models come in through the Godot import article, and a forest that uses these levels is the MultiMesh article.
Automatic mesh LODs
When Godot imports a mesh, it generates a chain of lower-detail versions and stores them in the mesh resource. At runtime the renderer picks a level from the mesh's size on screen, with no setup. This is on by default for every imported mesh.
The controls are in the Import dock, on the mesh or scene file, under Meshes: Generate LODs on or off, and LOD Normal Merge Angle and LOD Normal Split Angle, which decide how aggressively the simplifier merges faces. For a low poly model the simplifier removes the facets that are the style, so the automatic levels are right for the far distance and rough for the middle distance. The project setting rendering/mesh_lod/lod_change/threshold_pixels sets how eagerly the engine drops a level, and each GeometryInstance3D has an LOD Bias to scale it per node.
Visibility ranges
For control over what each level looks like, each level is its own node. Every VisualInstance3D, which includes MeshInstance3D, has Visibility Range Begin and End: the node is visible only when its distance from the camera is between them. Three MeshInstance3D nodes under one parent, with ranges of 0 to 40, 40 to 120 and 120 to 400 metres, are a hand-made LOD set, and the far one can be a billboard quad.
Visibility Range Begin Margin and End Margin add hysteresis, so a node does not flicker at the boundary; and Visibility Range Fade Mode decides what happens in the margin: Disabled for a hard swap, Self to fade the node itself, Dependencies to fade its children with it. A fade across a few metres hides the pop.
The ranges are in world metres, not screen size, so a big tree and a small one with the same ranges swap at the same distance whatever their size on screen; set them per model.
Which to use
Automatic LODs cost nothing to set up and are enough for props and rocks, where the far level is rarely looked at. Visibility ranges are for trees and anything whose far level should be a particular shape, or a billboard. They work together: each node in a visibility range set still gets its automatic mesh LODs within its range.
Fading between levels
Both systems can fade. Automatic mesh LODs cut hard by default; visibility ranges fade when a fade mode is set and a margin given. For a hand-made set, a margin of a few metres with Self fading is the equivalent of Unity's cross fade.
With a MultiMesh
A MultiMeshInstance3D draws thousands of copies of one mesh in one draw call, and each copy uses the mesh's automatic LODs, chosen per instance from its distance. Visibility ranges apply to the whole MultiMesh node, not per instance, so for a forest with hand-made levels you make one MultiMesh per level, each with its range, and the same instance transforms in each. The forest article does this.
What PolyMason exports
The tree builder writes LOD0, LOD1 and LOD2 as separate files with the same bounds and the same palette, so a visibility range set is three MeshInstance3D nodes under an empty. Or import LOD0 alone and let Godot's automatic LODs handle the rest, which for a low poly tree is acceptable at a distance and not before.
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 and buildings, how to make the levels so the swap does not pop, billboards and impostors for the far distance, and the LOD setup in Unity, Godot and Unreal.
- Unity's LOD Group, set up from separate model filesHow to build a LOD Group in Unity from three separate model files, what the screen-height thresholds mean, the naming convention that makes the importer build the group for you, fade modes, LOD Bias, and how LOD Groups get on with batching and instancing.
- Billboard trees in Unity: the far level of detailWhat 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.
- Tree colliders in Unity: a capsule on the trunk, not a mesh on the canopyWhy a tree's collider should be a capsule round the trunk and nothing round the canopy, how to set it up on a placed tree and on a terrain tree, what Generate Colliders on the importer does wrong, and the same in Godot and Unreal.
Or build a tree and see what comes out.