Features
Culling, levels of detail and performance
Tune frustum, distance, screen-size, occlusion and shadow culling, levels of detail and memory.
Every frame, for every camera, a compute shader tests each instance and writes the visible ones into one list per mesh level. Each level then draws with a single indirect draw call per material.
Culling
| Test | Settings |
|---|---|
| Distance | Renderer Max Distance, each prefab's Max Distance, and Distance Scale for quality levels. Instances dissolve over Fade Distance before the end. |
| Frustum | Each instance's bounding sphere against the camera planes. |
| Screen size | Each prefab's Min Screen Size, measured like Unity's LOD Group. |
| Occlusion | Occlusion Culling tests each instance's bounds against a depth pyramid built from the previous frame. URP and the Built-in Render Pipeline. |
| Shadows | Shadow casters are tested against the camera frustum extruded along the light, so trees outside the view still cast shadows into it, and nothing else is drawn into the shadow map. Shadow Distance limits them. |
Levels of detail
Each prefab's LOD Group sets its levels and screen sizes. LOD Bias multiplies the quality level's bias. Neighbouring levels cross-fade over Cross Fade Width of each level's range with screen-space dithering, so there is no pop and no transparency sorting. A prefab whose LOD Group has Fade Mode set to None switches without a fade.
Shadow casters use a level Shadow LOD Offset steps coarser than the camera sees, which saves most of the shadow cost of trees.
Streaming
- Upload Budget limits how many instances go to the GPU per frame. Adding a million trees spreads over a few frames instead of stalling one.
- The GPU instance buffer grows by half again when it fills, copying on the GPU.
- Terrain trees import Trees Per Frame at a time, and detail patches stream nearest first within the terrain source's time budget.
Tuning checklist
- Give every tree prefab an LOD Group and an impostor.
- Set Max Distance per prefab for small plants and rocks; they rarely need the renderer's full distance.
- Keep Shadow Distance at your pipeline's shadow distance, and raise Shadow LOD Offset for dense forests.
- Keep occlusion culling on in URP and the Built-in Render Pipeline for scenes with hills or buildings.
- Turn Collect Statistics off in shipping builds to skip the per frame readback.
Statistics
The renderer inspector shows instances, visible instances, draw calls and GPU memory. GetStatistics returns per prefab counts, levels, fallback materials and problems from code.
Still stuck?
Bring the renderer state with you.
Include the Kiwi Foliage version, Unity and render-pipeline versions, the graphics API, the Foliage Renderer's header state and statistics, the Shader Setup row for any shader involved, and a minimal scene.