This documentation is for a prerelease version of O3DE. Click here to switch to the latest release, or select a version from the dropdown.

Version:

Vegetation Layer Spawner Component

Use the Vegetation Layer Spawner component to define areas and rules for procedurally placing dynamic vegetation or other static meshes in your Open 3D Engine (O3DE) level.

With the Vegetation Layer Spawner component, you can do the following:

  • Create vegetation within a user-defined area at runtime.
  • Configure layer settings to determine the depth or relative ordering in which to apply vegetation layers.
  • Add Vegetation Modifier and Vegetation Filter components to add variation to placed vegetation.
  • Use the Vegetation Asset Weight Selector component to determine which vegetation assets to place at a given location.
  • Control the preview settings for attached components. Inherit behavior from a parent Vegetation Layer Blender component.

For information on how to use the Vegetation Layer Spawner, see Dynamic vegetation.

Provider

Vegetation Gem

Dependencies

Add the following required components when using the Vegetation Layer Spawner component:

Vegetation Layer Spawner properties

Vegetation Layer Spawner component properties

PropertyDescriptionValuesDefault
Override Preview SettingsIf Enabled, the Preview Settings properties determine the shape of the vegetation layer preview. If Disabled, the bounds of the vegetation layer preview are set by the attached Shape component.BooleanDisabled
Pin Preview to ShapeSets an entity with a compatible shape component to use as the bounds of the vegetation layer preview if Constrain to Shape is Enabled.

This field is available only if Override Preview Settings is Enabled.
EntityIdCurrent Entity
Preview PositionSets the world location of the vegetation layer preview.

This field is available only if Override Preview Settings is Enabled and there is no entity selected in Pin Preview to Shape.
Vector3: -Infinity to InfinityX:0.0, Y:0.0, Z:0.0
Preview SizeSets the dimensions of the vegetation layer preview if Constrain to Shape is Disabled.

This field is available only if Override Preview Settings is Enabled.
Vector3: 0.0 to InfinityX:1.0, Y:1.0, Z:1.0
Constrain to ShapeIf Enabled, the vegetation layer preview will use the bounds of the entity selected in Pin Preview to Shape.

This field is available only if Override Preview Settings is Enabled and an entity is selected in Pin Preview to Shape.
BooleanDisabled
Layer PriorityDefines the high level order that vegetation areas are applied.Background or ForegroundForeground
Sub PriorityDefines the order that vegetation areas are applied within a layer. Larger numbers have a higher priority.0-100000
Inherit BehaviorAllow shapes, modifiers and filters of a parent entity to affect this vegetation layer.BooleanEnabled
Allow Empty AssetsAllow unspecified assets to claim space and block other vegetation.BooleanEnabled
Filter StageDefines if filters are applied before or after modifiers.PreProcess or PostProcessPreProcess

VegetationSpawnerRequestBus

Use the following request functions with the VegetationSpawnerRequestBus EBus interface to communicate with Vegetation Layer Spawner components in your game.

Method NameDescriptionParameterReturnScriptable
GetAllowEmptyMeshesReturns True if Allow Empty Assets is Enabled.NoneBooleanYes
GetAreaLayerReturns the Layer Priority of the vegetation layer.NoneLayer Priority: StringYes
GetAreaPriorityReturns the Sub Priority of the vegetation layer.NoneSub Priority: IntegerYes
GetAreaProductCountReturns the number of vegetation instances spawned in a vegetation layer.NoneCount: IntegerYes
GetFilterStageReturns the Filter Stage of the vegetation layer.NoneFilter Stage: StringYes
GetInheritBehaviorReturns True if Inherit Behavior is Enabled.NoneBooleanYes
SetAllowEmptyMeshesSets the value of the Allow Empty Assets property.BooleanNoneYes
SetAreaLayerSets the value of the Layer Priority property.Layer Priority: StringNoneYes
SetAreaPrioritySets the value of the Sub Priority property.Sub Priority: IntegerNoneYes
SetFilterStageSets the value of the Filter property.Filter Stage: StringNoneYes
SetInheritBehaviorSets the value of the Inherit Behavior property.BooleanNoneYes