Lumberyard
User Guide (Version 1.15)

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.

Rain Component Properties

The Rain component has the following properties:

Enabled

Specifies whether rain effects are enabled.

Default value: True

Ignore VisArea

Specifies whether the Rain component ignores visible areas. For more information, see the VisArea component.

Default value: False

Disable Occlusion

Specifies 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

Radius

Radius 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

Amount

Amount of rain and other effects that the Rain component creates.

Default value: 1

Valid values: 0 to 100

Diffuse Darkening

Amount of darkening that is applied to surfaces that the rain affects.

Default value: 0.5

Valid values: 0 to 1

Drops

The Rain component has the following raindrop options:

Amount

Quantity of raindrops.

Default: 0.5

Valid values: 0 to 100

Speed

Speed of the falling raindrops.

Default: 1.0

Valid values: 0 to 100

Lightning

Brightness of the raindrops.

Default: 1.0

Valid values: 0 to 100

Puddles

The Rain component has the following puddle options:

Amount

Amount of depth and brightness of rain puddles.

Default: 1.5

Valid values: 0 to 10

Mask Amount

Strength of the puddle mask. A value of 1 creates puddles of rain between patches of land.

Default: 1

Valid values: 0 to 1

Ripple Amount

Strength and frequency of the ripples in the rain puddles.

Default: 2

Valid values: 0 to 100

Splashes Amount

Strength 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 about using the event bus (EBus) interface, see Working with the Event Bus (EBus) System.

Enable

Enables rain effects.

Parameters

None

Return

None

Scriptable

Yes

Disable

Disables rain effects.

Parameters

None

Return

None

Scriptable

Yes

Toggle

Toggles whether rain effects are enabled.

Parameters

None

Return

None

Scriptable

Yes

IsEnabled

Returns true if rain effects are enabled.

Parameters

None

Return

Type: Boolean

Scriptable

Yes

SetIgnoreVisAreas

Specifies 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.

Parameters

Type: Boolean

Return

None

Scriptable

Yes

GetIgnoreVisAreas

Returns true if rain effects ignore visible areas.

Parameters

None

Return

Type: Boolean

Scriptable

Yes

SetDisableOcclusion

Specifies 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.

Parameters

Type: Boolean

Return

None

Scriptable

Yes

GetDisableOcclusion

Returns true if rain effects affect objects that are marked as occluders.

Parameters

None

Return

Type: Boolean

Scriptable

Yes

SetRadius

Sets the radius of rain effects. The Rain component creates puddles inside only the specified radius. Raindrops always render in the level.

Parameters

Type: Float

Return

None

Scriptable

Yes

GetRadius

Returns the radius of rain effects.

Parameters

None

Return

Type: Float

Scriptable

Yes

SetAmount

Sets the overall amount of rain, puddles, and splashes.

Parameters

Type: Float

Return

None

Scriptable

Yes

GetAmount

Returns the overall amount of rain, puddles, and splashes.

Parameters

None

Return

Type: Float

Scriptable

Yes

SetDiffuseDarkening

Sets the amount of darkening that is applied to surfaces that the rain affects.

Parameters

Type: Float

Return

None

Scriptable

Yes

GetDiffuseDarkening

Returns the amount of darkening that is applied to surfaces that the rain affects.

Parameters

None

Return

Type: Float

Scriptable

Yes

SetRainDropsAmount

Sets the amount of raindrops that appear.

Parameters

Type: Float

Return

None

Scriptable

Yes

GetRainDropsAmount

Returns the quantity of raindrops that appear.

Parameters

None

Return

Type: Float

Scriptable

Yes

SetRainDropsSpeed

Sets the speed of raindrops.

Parameters

Type: Float

Return

None

Scriptable

Yes

GetRainDropsSpeed

Returns the speed of raindrops.

Parameters

None

Return

Type: Float

Scriptable

Yes

SetRainDropsLighting

Sets the brightness of the raindrops.

Parameters

Type: Float

Return

None

Scriptable

Yes

GetRainDropsLighting

Returns the brightness of the raindrops.

Parameters

None

Return

Type: Float

Scriptable

Yes

SetPuddlesAmount

Sets the amount of depth and brightness of the puddles.

Parameters

Type: Float

Return

None

Scriptable

Yes

GetPuddlesAmount

Returns the amount of depth and brightness of the puddles.

Parameters

None

Return

Type: Float

Scriptable

Yes

SetPuddlesMaskAmount

Sets the strength of the puddle mask applied to the puddles.

Parameters

Type: Float

Return

None

Scriptable

Yes

GetPuddlesMaskAmount

Returns the strength of the puddle mask applied the puddles.

Parameters

None

Return

Type: Float

Scriptable

Yes

SetPuddlesRippleAmount

Sets the strength and frequency of the ripples in puddles.

Parameters

Type: Float

Return

None

Scriptable

Yes

GetPuddlesRippleAmount

Returns the strength and frequency of the ripples in puddles.

Parameters

None

Return

Type: Float

Scriptable

Yes

SetSplashesAmount

Sets the strength of the splash effects that the rain creates.

Parameters

Type: Float

Return

None

Scriptable

Yes

GetSplashesAmount

Returns the strength of the splash effects that the rain creates.

Parameters

None

Return

SnowOptions

Scriptable

Yes

SetRainOptions

Sets all options for the Rain component.

Parameters

RainOptions

Return

None

Scriptable

Yes

GetRainOptions

Returns a data structure that contains all options for the Rain component.

Parameters

None

Return

RainOptions

Scriptable

Yes

UpdateRain

Updates 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.

Parameters

None

Return

None

Scriptable

Yes

Request Bus Example Script

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