Level of detail
Every prefab and every live plant has three detail levels in a standard Unity LOD Group. Unity picks the level by how tall the plant is on screen.
The three levels
- LOD 0, full detail
- While the plant is taller than 40% of the screen.
- LOD 1, medium detail
- From 40% down to 15% of the screen.
- LOD 2, low detail
- From 15% down to 2%. Below 2% the plant is not drawn.
The three meshes are built from the same plant, and they share its material and colours. Every pack ships with these switch points.
Screen height, not distance
A switch point is a share of the screen's height, so the distance it stands for depends on the plant's size, the camera's field of view and the project's LOD Bias. A small plant switches, and disappears, much closer than a large one:
- A 0.3 m flower
- Full detail to about 0.6 m, medium to about 1.7 m, not drawn beyond about 13 m.
- A 2 m bush
- Full detail to about 4 m, medium to about 12 m, not drawn beyond about 87 m.
- A 6 m tree
- Full detail to about 13 m, medium to about 35 m, not drawn beyond about 260 m.
These distances are worked out from Unity's rule for a camera with a 60° vertical field of view and LOD Bias 1; a plant counts by its largest dimension. As a rule of thumb: full detail within twice the plant's size, medium within six times, gone beyond about forty times. To see where a plant stands, select it and move the Scene view camera: the LOD Group's bar in the Inspector marks the camera's place.
Change everything at once
Edit › Project Settings › Quality › LOD Bias scales every distance in the project. At 2, plants keep each level twice as far and disappear twice as far; at 0.5, half as far. This is the quickest fix when plants switch or vanish too early.
- LOD Bias is set per quality level: check each level your game uses.
- It applies to every LOD Group in the project, not only to Floralin's plants.
- From a script it is
QualitySettings.lodBias.
Change some plants
Select the plants and edit the LOD Group in the Inspector: drag the borders between the levels on its bar, or type a level's transition percentage. With several plants selected, the change applies to all of them.
- Plants placed in a scene, prefabs and live plants alike: the change is saved with the scene. In the Hierarchy's search field,
t:LODGrouplists every object with an LOD Group andt:FloralinPlantevery live plant, ready to select together. - A prefab, everywhere it is used: edit the LOD Group of the prefab itself. Placed copies follow unless you changed them in the scene.
Keep the percentages in order: LOD 0 above LOD 1, LOD 1 above the point where the plant is no longer drawn.
Live plants
A live plant adds its LOD Group itself and starts from the pack's switch points. Once you change them they are yours: the plant keeps them when it regrows with another form, specimen or palette, and they are saved with the scene. Bake to prefab gives the baked prefab the plant's own switch points.
Turn LOD Group off on a live plant for one mesh at the Detail you choose, with no switching.
Pack updates
An update replaces the pack's prefabs, switch points included: a change you made inside a pack's own prefab goes back to the pack's values. What you changed on plants placed in a scene stays, and so do your baked plants in Assets/Floralin/Baked/.
To keep your own switch points on a prefab across updates, make a Prefab Variant of it outside the pack's folder, change the variant and place that. See Several packs and updates.