IN THIS ARTICLE
Sky Cloud
Sky Cloud
This feature is in preview release and is subject to change. |
The Sky Cloud component creates realistic and detailed cloud effects in your game levels. To use the Sky Cloud component, you must enable the Sky Clouds gem in your project. For more information, see Add modular features and assets with Gems.
For information about cloud shading settings, placing distance clouds, and adding cloud shadows, see Adding Clouds.
Note
The Sky Cloud component replaces
legacy clouds .
Example Sky Cloud Component
Lumberyard features two variations of cloud rendering:
Common clouds
This sprite-based rendering path uses simple shading to optimize performance. Close up, these clouds appear in 3D but once the clouds are a certain configurable distance from the viewer, an
imposter is substituted.
Volumetric clouds
This implementation uses advanced shading to create realistic
voxelized 3D clouds but is slower to render.
With the Sky Cloud component, you can do the following:
- Randomly generate common and volumetric clouds in controlled areas.
- Control where clouds generate by using entities with Box Shape components.
- Define the area in which clouds can move with a loop box.
- Programmatically manage Sky Cloud component properties with the Script Canvas editor, Lua scripting, and the Track Editor.
- Create and use slices that include cloud components.
The following procedure demonstrates how to create a common or volumetric cloud with the Sky Cloud component. After you create a cloud, you can customize its appearance and movement using the procedures in this chapter.
Topics
- Creating a Cloud with the Sky Cloud Component
- Sky Cloud Component Properties
- Creating a Loop Box
- Setting Fade Distance
- Changing the Cloud Display
- Setting Up Cloud Generation Areas
Creating a Cloud with the Sky Cloud Component
To create a cloud
In the Entity Outliner, select the new entity and in the Entity Inspector, click Add Component and then click the Sky Cloud component.
Click Add Required Component to add the Box Shape component.
In the Entity Inspector, at the bottom of the Sky Cloud component properties, click Generate. This generates a common cloud that uses sprite-based shading in the viewport.
To turn the common cloud into a volumetric cloud, select the Volumetric Rendering property.
Sky Cloud Component Properties
The Sky Cloud component properties are grouped into the following categories. See the individual sections for detailed descriptions for the available parameters.
Cloud material
Sets the material for
common cloud rendering. The default material is baseclouds.mtl
. To select a different material, click (…) and choose a material based on the common cloud shader.
Volumetric Rendering
Enables
volumetric cloud rendering and specifies the cloud’s material and density.
Movement
Defines how the clouds move over time.
Display
Controls which visual aids are displayed when viewing the cloud in Lumberyard Editor.
Generation
Defines parameters for cloud generation when you click Generate.
Volumetric Rendering Parameters
When you enable Volumetric Rendering, you create a realistic-looking volumetric cloud that is voxelized and uses the Volume Object shader.
When Volumetric Rendering is not enabled, you create a sprite-based common cloud, which uses the Common Cloud shader.
Name | Description |
---|---|
Enabled | If selected, this cloud is drawn with volumetric rendering. If not selected, the common cloud shader is used. |
Volume material | Volume Object based material used for rendering volumetric clouds. Volumetric rendering must be enabled for this parameter. Th default material is volumeClouds.mtl. |
Density | Defines the volumetric cloud’s density. Volumetric rendering must be enabled for this parameter. |
Movement Parameters
The Movement parameters define how the cloud moves within its loop box.
Name | Description |
---|---|
AutoMove | If selected, the cloud moves on its own. |
Velocity | Velocity in meters per second and cloud movement in the X, Y, and Z axes. |
FadeDistance | Distance in meters from the loop box edge. Defines where the cloud begins to fade out before wrapping around to the other side. |
Display Parameters
Enable Display parameters to help visualize the cloud while editing.
Name | Description |
---|---|
Display Spheres | Displays a sphere for each particle. Enable this parameter to visualize the overall volume of the cloud. |
Display Volumes | Displays the box for each volume that is part of the cloud. Enable this parameter to see the general shape of the cloud. For more information, see Setting Up Cloud Generation Areas. |
Display Bounds | Displays the bounds of the entire cloud including all particles. Enable this parameter to help you place clouds. |
Generation Parameters
The Generation parameters define variables to create clouds through procedural generation.
Name | Description |
---|---|
Rows | Number of rows in cloud texture. If the default cloud material or volume material is specified, keep the value at 4. |
Seed | Seed for random number generator. A particular seed generates the same set of clouds regardless of where it’s used. |
Columns | Number of columns in cloud texture. If the default cloud material or volume material is specified, keep the value at 4. |
Sprites | Number of sprites to be generated. |
Render Row | Row in the cloud texture that is designated for rendering. |
Scale | Base scale of the sprites in the cloud. |
Size Variation | Random variance in size of the sprites within the cloud. |
Min Distance | Minimum distance between the generated sprites within the cloud. |
Fill By Volume | Fills boxes on the child entities based on volume. |
Fill By Loopbox | Fills the loop box volume (as opposed to the box volumes on the child entities). |
Generate | Creates a cloud based on the current generation variables. |
Creating a Loop Box
When you add a Sky Cloud component to an entity, you also add a Box Shape component to function as a loop box. The loop box specifies the bounds in which the cloud can move. When the cloud reaches one side of the loop box, the cloud automatically repositions to the other end so that its movement loops.
To set up the loop box
In the Entity Outliner, select the entity with the Sky Cloud component.
In the Entity Inspector, modify the Box Shape component. Set the Dimensions values to your preferred loop box size.
For example, X = 500.00 m, Y = 500.00 m, Z = 200.00 m.
To see the cloud’s movement within the loop box, select AutoMove in the Sky Cloud component properties.
Setting Fade Distance
The Fade Distance determines where the cloud begins to fade out as it reaches the edge of the loop box. This prevents the cloud from popping in and out at the edges of the box.
With smaller values, the cloud fades out close to the edge of the loop box. With larger values, the cloud begins to fade closer to the middle of the loop box.
Example
The following images show two clouds.
Cloud (1) is near the edge of the loop box but appears solid because of a small fade value. Cloud (2) is equally near the edge but appears faded because of a larger fade value.
To set the fade distance
In the Entity Outliner, select the entity with the Sky Cloud component.
In the Entity Inspector, in the Sky Cloud component properties, adjust the FadeDistance slider or enter a value in the FadeDistance box. Note
This value, measured in meters, should not exceed half of the length of the loop box in the direction that the cloud is moving.
Changing the Cloud Display
The Sky Cloud component’s Display parameters change how the cloud is displayed in the viewport. You can use these parameters to visualize aspects of the cloud.
When Display Spheres is selected, the viewport displays a sphere for each cloud particle.
To display the cloud as spheres
In the Entity Outliner, select the entity with the Sky Cloud component.
In the Entity Inspector, in the Sky Cloud component properties, select Display Spheres.
Example
When Display Volumes is selected, the viewport displays the boxes that make up each part of the cloud volume. For more information, see Setting Up Cloud Generation Areas.
To display the cloud as volumes
In the Entity Outliner, select the entity with the Sky Cloud component.
In the Entity Inspector, in the Sky Cloud component properties, select Display Volumes.
Example
When Display Bounds is selected, the viewport displays a box that includes all areas of the cloud.
To display the cloud’s bounds
In the Entity Outliner, select the entity with the Sky Cloud component.
In the Entity Inspector, in the Sky Cloud component properties, select Display Bounds.
Example
Setting Up Cloud Generation Areas
You can set up cloud generation areas to customize the shape of your cloud. To define these areas, add Box Shape components to child entities under the main parent entity.
To define cloud generation areas
Create an entity with a descriptive name, such as CloudGenerator.
This will be the parent entity for your cloud generation areas.
Add the Sky Cloud and Box Shape components to the entity.
In the Entity Inspector, for the Sky Cloud component, clear the Fill by Loopbox check box.
Clearing this option makes the clouds render inside the child entities rather than in the current entity’s box shape.
Create another entity with a descriptive name, such as CloudVolume1, and then add the Box Shape component.
Modify the dimensions and position of the Box Shape component to accommodate a cloud that you want to create.
Repeat the previous two steps, adding new entities until you achieve the configuration that you want for your clouds.
To parent all of the entities to the CloudGenerator entity, select all of the entities and drag it to the parent entity.
Select the parent entity and in the Entity Inspector, for the Sky Cloud component, click Generate.