Terrain Provider
Render Unity Terrain trees and details with Flora.
The Terrain Provider lets Flora render a Unity Terrain's trees and details.
Auto Register Terrains adds providers automatically. Disable a provider to opt out that Terrain.
For non-Terrain workflows, use Instance Container or Instance Renderer.
Trees
Trees load when a camera and its far plane enter the Terrain's treeDistance.
Tree Distance controls streaming and maximum render distance.
Use Prototype Layers uses each prototype GameObject's layer when enabled. When disabled, every tree uses the Terrain GameObject's layer.
Tree Motion Vectors follows
Terrain.treeMotionVectorModeOverride; Inherit From Prototype uses the prototype renderers.Bake Light Probe Positions edits
Terrain.bakeLightProbesForTrees, which controls whether Unity adds tree positions to a legacy light-probe bake.Tree Spatial Cache controls whether this Terrain's trees participate in Static Spatial Caching.
Compatible SpeedTree prototypes animate automatically. Configure shared or per-Terrain sampling in Scene Settings; see SpeedTree Wind for requirements and performance guidance.
These controls edit the Terrain directly and update while it is tracked. Bake Light Probe Positions affects baking only; runtime probe use follows the prototype Renderers and LODGroup.

Details
Details stream when a camera and its far plane enter the Terrain's detailObjectDistance. Flora generates their placements on the GPU.
Detail Distance and Detail Density Scale edit the Terrain. Motion vectors and layers come from prototype Renderers. Details use APV when available and do not store legacy probe data.
Details remain loaded for the unload hysteresis after leaving range. The default is 0.5 seconds.
Increasing Detail Distance increases the streamed area and memory use.
Flora supports detail meshes with LODGroups. Unity's fallback renderer uses only the first LOD mesh.
Terrain details are transient GPU data. They do not create FloraInstanceHandle values, do not appear in instance queries, and do not participate in Static Spatial Caching.
Query nearby detail prototypes
FloraTerrainDetailQuery specifies the prototype EntityId to find, a position, a radius, and optionally one Terrain. Use ScheduleTerrainDetailQuery for one asynchronous query, RunTerrainDetailQuery for one immediate query, or ScheduleTerrainDetailQueries with caller-owned NativeArray inputs and outputs for a batch.
Immediate execution completes outstanding Flora terrain work first. When the result is not required synchronously, overlap the query with independent work:
Dispose the request after reading its result. Do not copy it; copies share the same pooled storage.
For multiple queries, allocate equally sized query and result arrays and schedule the batch directly:
Results contain the prototype EntityId, population Count after density scaling, and Present. Batch queries write into caller-owned result arrays.
Queries inspect resident terrain-detail data and never request missing patches or expand the streaming region. A NotResident result has a zero count. Let normal camera streaming make the region resident, or create a terrain streaming sphere for a region that must stream without a camera:
Keep the handle for as long as the region should remain streamed, update it when the target moves, and dispose it when finished. Do not copy the handle. The sphere participates in terrain tree and detail streaming. Terrain detail distance caps its detail-patch radius, while tree streaming continues to use the Terrain's tree distance. After streaming has progressed, schedule the query again on a later frame.
Results are aggregated at detail-cell resolution. They do not account for GPU hole or footprint rejection.

Last updated