Level of Detail
Level of Detail (LOD) management involves adjusting the complexity of 3D model representations based on their distance from the viewer. The primary goal of LOD is to optimize rendering performance while maintaining visual quality.
Geometry
To implement the level of detail you can use multiple representations of the same object, depending on the distance of the viewer. For example, a glTF detailed model of a maple tree can be replaced by a simple abstract tree shape when viewed from far.
Far | Near |
---|---|
![]() | ![]() |
Solids
The simplified representation of a maple tree is defined by a cone and a cylinder.
A semi detailed representation of the main building is defined by a solid with repetition statements which create floors and walls.
Topics
To specify a level of detail you need to specify a distance and a geometry for each level of detail. The distance is specified in meters and the geometry can be a solid, a script of a glTF file. You can specify multiple entries separated by a |
character.
[DISTANCE]:[GEOMETRY] | [DISTANCE]:[GEOMETRY]
In the example below the geometry changes from a detailed maple_tree.glb
to a simple ConeTree.gltf
when the distance is more than 500 meter. The geometry of the parking is replaced by a simple block when viewed from more than 1000 meters.
htc.landscape.tree_1.geometry = maple_tree.glb | 500:ConeTree.gltf
htc.buildings.parking.p1.geometry = campus.Parking.gltf|1000:block(61, 32, 50)
Zoom
From a far distance all geometry is displayed by simple geometry, enabling fast zooming and panning.
When clicking on the +
icon the camera zooms in and a more detailed representation of the buildings is displayed.
After zooming in further the detailed model of the tree is displayed.