Version:

Rain

Rain


This feature is in preview release and is subject to change.

You can use the Rain component to create rain effects, puddles, and ripples on the terrain. You can add multiple Rain components to your entities in a level, but the level uses only one of the Rain components. The last Rain component to activate takes priority and Lumberyard renders that component.

To enable the Rain component, you must enable the Rain gem. For more information, see Rain Gem.

[Add the Rain component to your entity to enable rain effects in your level.]

Note
If your level has a Snow and Rain component, the component that activates last takes priority; you cannot enable both Snow and Rain components at the same time.

Contents

Turning Rain On or Off

You can toggle rain on or off in Lumberyard Editor by enabling or disabling AI/Physics, or by running or stopping the game.

To toggle rain effects on or off in Lumberyard Editor

  • Do one of the following:
    • On the bottom right of the viewport, click AI/Physics.
    • Choose Game, Enable Physics/AI.
    • Press Ctrl+P.
    • Press Ctrl+G to enter gameplay mode. Press Esc to stop the game.

Editing Rain Effects

You can edit rain effects only when the AI/Physics toggle is disabled.

To edit rain effects

  1. Disable AI/Physics.

  2. Make changes to the Rain component properties.

  3. Enable AI/Physics. After you reenable AI/Physics, your changes appear in the viewport.

Rain Component Properties

[Rain component properties to customize the rain effects in your level.]

The Rain component has the following properties:


PropertyDescription
EnabledSpecifies whether rain effects are enabled. Default value: True
Use VisAreaSpecifies whether rain appears when the player is inside of a visible area. For more information, see the VisArea component. Default value: False
Disable OcclusionSpecifies whether objects will ignore rainfall effects. You can enable the Rain occluder parameter in the Mesh component for your objects; rain effects do not affect these objects. For more information, see Mesh Component: Advanced Options. Default value: False
RadiusRadius of the area where puddles are created. Rain continues to affect the screen even outside the specified radius. Default value: 10000 Valid values: 0 to 10000
AmountAmount of rain and other effects that the Rain component creates. Default value: 1 Valid values: 0 to 100
Diffuse DarkeningAmount of darkening that is applied to surfaces that the rain affects. Default value: 0.5 Valid values: 0 to 1
The Rain component has the following raindrop options.
AmountQuantity of raindrops. Default: 0.5 Valid values: 0 to 100
SpeedSpeed of the falling raindrops. Default: 1.0 Valid values: 0 to 100
LightingBrightness of the raindrops. Default: 1.0 Valid values: 0 to 100
The Rain component has the following puddle options.
AmountAmount of depth and brightness of rain puddles. Default: 1.5 Valid values: 0 to 10
Mask AmountStrength of the puddle mask. A value of 1 creates puddles of rain between patches of land. Default: 1 Valid values: 0 to 1
Ripple AmountStrength and frequency of the ripples in the rain puddles. Default: 2 Valid values: 0 to 100
Splashes AmountStrength and frequency of the splashes that the raindrops create. Default: 1.3 Valid values: 0 to 1000

EBus Request Bus Interface

Use the following request functions with the EBus interface to communicate with other components of your game. You can use this EBus to communicate to an entity with a Rain component attached. The EBus is available at game run time and editing and can be accessed from C++, Lua, and the Script Canvas editor.

When set, the individual setters on this bus update the rain simulation immediately. This can cause performance implications if you want to change multiple parameters. To avoid this, you can set multiple parameters at once with GetRainOptions and SetRainOptions.

For more information , see Working with the Event Bus (EBus) system.


Request NameDescriptionParametersReturnScriptable
EnableEnables rain effects.NoneNoneYes
DisableDisables rain effects.NoneNoneYes
ToggleToggles whether rain effects are enabled.NoneNoneYes
IsEnabledReturns true if rain effects are enabled.NoneType: BooleanYes
SetIgnoreVisAreasSpecifies whether rain effects ignore visible areas. If true, the rain effects are visible, even inside visible areas. If false, rain does not render in a visible area. For more information, see the VisArea component.Type: BooleanNoneYes
GetIgnoreVisAreasReturns true if rain effects ignore visible areas.NoneType: BooleanYes
SetDisableOcclusionSpecifies whether rain effects affect objects that are marked as occluders. You can enable the Rain occluder parameter in the Mesh component for your objects; rain effects do not affect these objects. For more information, see Mesh Component: Advanced Options. If true, objects marked as rain occluders are affected by rain effects. If false, objects marked as rain occluders ignore rain effects.Type: BooleanNoneYes
GetDisableOcclusionReturns true if rain effects affect objects that are marked as occluders.NoneType: BooleanYes
SetRadiusSets the radius of rain effects. The Rain component creates puddles inside only the specified radius. Raindrops always render in the level.Type: FloatNoneYes
GetRadiusReturns the radius of rain effects.NoneType: FloatYes
SetAmountSets the overall amount of rain, puddles, and splashes.Type: FloatNoneYes
GetAmountReturns the overall amount of rain, puddles, and splashes.NoneType: FloatYes
SetDiffuseDarkeningSets the amount of darkening that is applied to surfaces that the rain affects.Type: FloatNoneYes
GetDiffuseDarkeningReturns the amount of darkening that is applied to surfaces that the rain affects.NoneType: FloatYes
SetRainDropsAmountSets the amount of raindrops that appear.Type: FloatNoneYes
GetRainDropsAmountReturns the quantity of raindrops that appear.NoneType: FloatYes
SetRainDropsSpeedSets the speed of raindrops.Type: FloatNoneYes
GetRainDropsSpeedReturns the speed of raindrops.NoneType: FloatYes
SetRainDropsLightingSets the brightness of the raindrops.Type: FloatNoneYes
GetRainDropsLightingReturns the brightness of the raindrops.NoneType: FloatYes
SetPuddlesAmountSets the amount of depth and brightness of the puddles.Type: FloatNoneYes
GetPuddlesAmountReturns the amount of depth and brightness of the puddles.NoneType: FloatYes
SetPuddlesMaskAmountSets the strength of the puddle mask applied to the puddles.Type: FloatNoneYes
GetPuddlesMaskAmountReturns the strength of the puddle mask applied the puddles.NoneType: FloatYes
SetPuddlesRippleAmountSets the strength and frequency of the ripples in puddles.Type: FloatNoneYes
GetPuddlesRippleAmountReturns the strength and frequency of the ripples in puddles.NoneType: FloatYes
SetSplashesAmountSets the strength of the splash effects that the rain creates.Type: FloatNoneYes
GetSplashesAmountReturns the strength of the splash effects that the rain creates.NoneSnowOptionsYes
SetRainOptionsSets all options for the Rain component.RainOptionsNoneYes
GetRainOptionsReturns a data structure that contains all options for the Rain component.NoneRainOptionsYes
UpdateRainUpdates Lumberyard to use this Rain component as the base for rain effects. The Rain component that is called last takes priority; Lumberyard uses that component.NoneNoneYes

Request Bus Example Script

function example:OnActivate()
    RainComponentRequestBus.Event.SetAmount(self.entityId, 5.0)
    RainComponentRequestBus.Event.Toggle(self.entityId)
end