
GPU Resident Drawer
Information about using Flora with Unity's GPU Resident Drawer.
You can use Flora alongside Unity's GPU Resident Drawer, but there are key technical differences to understand and be aware of.
GameObjects
GPU Resident Drawer requires GameObjects and MeshRenderer components in the scene to work. Flora on the other hand can render prefab instances without requiring GameObjects. This allows Flora to handle terrain trees and details, container instances, and even runtime instances.
Memory Usage
GPU Resident Drawer treats each MeshRenderer as a separate instance, resulting in increased GPU memory usage in complex LOD scenarios. For example, each MeshRenderer instance may include memory overhead for motion vectors, light probe data, and SpeedTree animation parameters:
ObjectToWorld
float3x4
1
48 bytes
WorldToObject
float3x4
1
48 bytes
PrevObjectToWorld
float3x4
1
48 bytes
PrevWorldToObject
float3x4
1
48 bytes
SH (Light Probes)
float4
9
144 bytes
World Bounding Sphere
float4
1
16 bytes
SpeedTree Wind
int4
16
256 bytes
The world bounding sphere is added if GPU Occlusion is present, and the wind parameters are added if the MeshRenderer has a Tree component. A complete tree MeshRenderer instance over half of a MB.
For instance, a SpeedTree LODGroup with four MeshRenderers can reach approximately 1GB of GPU memory at around 400,000 instances. However, Unity's current architecture practically limits such high instance counts anyways due to GameObject overhead, though this may evolve in the future.
Flora on the other hand treats each LODGroup as a single instance: only ever allocating space for motion vectors (previous transforms) and light probes on demand. This can save a lot of space, especially when working with large instance counts.
Terrain Rendering
GPU Resident Drawer cannot render Terrain details or trees because it currently depends on MeshRenderers within the scene. Flora, or alternative instancing solutions, are the only method of currently rendering Terrain instances outside of the builtin system.
GPU Occlusion Culling
Both Flora and GPU Resident Drawer use the same GPU occlusion culling technique, but each maintains separate resources. Using both simultaneously will cause double depth sampling overhead. Unity does not expose GPU Resident Drawer's internal occlusion resources or parameters, so there currently is no way for Flora to piggy back on that system.
It's recommended to select either Flora or GPU Resident Drawer's GPU occlusion to avoid performance overhead, particularly on lower-end hardware.
Feature Comparison
CPU Only Culling
❌
☑️
GPU Indirect Culling
☑️
☑️
GPU Occlusion Culling
☑️
☑️
GameObject Instancing
☑️
☑️
Non-GameObject Instancing
☑️
❌
Terrain Foliage Instancing
☑️
❌
Last updated