Working with LODs
Last updated
Last updated
Uranus Instancer makes it easy to add Level of Detail (LOD) support in your scene.
To enable LOD support find the Uranus Instancer script component and make sure all required global LOD levels are set in the Lod Levels
property:
You can add up to 10 unique LOD levels. Each level requires:
index: the Lod Level index used for identifying each level of detail(LOD0, LOD1 etc.).
start: the distance from the active camera this LOD level will get enabled at.
end: the distance from the active camera this LOD level will get disabled at. If set to 0 this LOD level will remain enabled even after the end distance is reached (useful for the last LOD).
LOD levels can be overlapping if required, but a good practice is to have them start/end at the exact distances.
For an object to use LOD levels there are some simple rules that need to be followed:
Entities should be using a render component.
The entity name should have the required suffix in its name: _LOD0
_LOD1
_LOD2
etc.
LOD entities should be in order under the same parent.
These entities will automatically toggle on/off based on their distance from the active camera.
Whereas global LOD levels make it easy to quickly get started with level of details, in most cases your application will require finer control over LOD distances.
You can easily override the global LOD levels per entity by attaching the uranus-instancer-lod.js
script.
There is a simple rule on how that should be done:
Attach the script in all LOD entities and set the exact LOD levels (LOD0, LOD1, LOD2) in all entities at the same time (multi-select the entities and set the required levels).
This script provides additional options when compared with the global LOD levels. These options are:
layer: you can override the LOD levels only for a specific scene layer by adding a comma separated list of layer names. If set to empty, LOD levels will be overridden for all layers.
layerType: When specifying a layer to override you can also target if the LOD settings affect the Model or the Shadow or both (All). This is useful for setting different LOD levels for certain render states (e.g. have a billboard LOD for casting tree shadows or water reflections to improve performance).