Method RequestBiomeData
RequestBiomeData(IBiome, BiomeDataRequest, TerrainGraph, Bounds, Space, int, int, GraphInputContainer, BiomeDataMask, FillArgumentsHandler)
Executes a terrain graph for one biome request and fills the requested output channels into BiomeData.
public static IEnumerator RequestBiomeData(IBiome biome, BiomeDataRequest request, TerrainGraph graph, Bounds biomeWorldBounds, Space simSpace, int baseResolution, int seed, GraphInputContainer inputContainer = null, BiomeDataMask dataMask = (BiomeDataMask)-1, TerrainGraph.FillArgumentsHandler fillArgumentsCallback = null)
Parameters
biomeIBiomeThe biome requesting data. This is used for editor progress reporting and for identifying the source of the generation request.
requestBiomeDataRequestThe asynchronous request whose data instance will receive the generated outputs.
graphTerrainGraphThe terrain graph to execute.
biomeWorldBoundsBoundsThe biome bounds that define the height scale and horizontal coverage of the graph request.
simSpaceSpaceThe coordinate space in which the graph should evaluate its bounds. In local space the request starts at the origin; in world space it uses the biome's world minimum XZ.
baseResolutionintBase graph resolution for this request. It must already be compatible with the graph's compute-shader constraints.
seedintBase random seed used to initialize the execution arguments.
inputContainerGraphInputContainerOptional external graph inputs, such as Local Procedural Biome masks, scene height, custom textures, or uploaded point buffers.
dataMaskBiomeDataMaskBitmask that selects which output categories should be requested and extracted. Output nodes outside these categories are ignored for this run.
fillArgumentsCallbackTerrainGraph.FillArgumentsHandlerOptional callback that appends extra execution arguments before the graph starts.
Returns
- IEnumerator
An enumerator that executes the graph asynchronously, transfers selected outputs into the request's BiomeData, and completes
requestwhen finished.
Remarks
The method first discovers the output nodes that match the requested
dataMask. For some categories it also filters out nodes whose referenced
templates or terrain layers are not usable.
Once execution completes, outputs are removed from data in category order and written into the request data. Removing them from the pool transfers ownership away from the execution handle so the final handle.Dispose call does not destroy them.
If the mask resolves to no output nodes, the request completes immediately without running the graph.
Exceptions
- ArgumentException
Thrown when
baseResolutionis invalid for graph execution.