Improving your sky with clouds

Clouds are just one example of the various object types and features supported in CryENGINE 3.

Getting ready

You should have the level live_create_small open.

How to do it...

Let's use the different cloud entities available to us to populate our sky with:

  1. Drag a Cloud entity into the level.
  2. Place it at above 1000 meters (Z value = 1000).
  3. Make sure that the Cloud entity is selected, so that its properties are displayed in the RollupBar, then click the MTL <No Custom Material> icon.
  4. This opens the Material Editor, where you can select the the desired Cloud Material. Make sure that the Common.Cloud Shader is selected in the Material settings.
  5. Scale it by selecting the Scale tool from the Toolbar, making sure to select all three axes.
  6. In order to enable cloud movement, set the AutoMove property to True and set a fade distance to 100 to make them fade in when they reach the edge of the box in which they are moving.
  7. Then, you need to define how big the box (SpaceLoopBox)—in which they are moving from one end to the other—should be. 2000 is the default value for all three axes.
  8. Finally, you need to set the speed at which they will move. For normal clouds, you can use 5, and for storm clouds, about 15. Experiment a bit, but remember that if you want to select a cloud, it's wise to turn off AutoMove; otherwise, it can be difficult to select the cloud.

The Distance Cloud Tool allows you to place planes in the sky that look like clouds if the right texture is assigned. They are great for creating a realistic distant sky setup for your level without causing huge render slowdown issues. Distance Clouds are basically horizontal planes placed into the sky. Unlike other types of clouds they cannot be flown through and thus, they're mostly suitable for filling the sky in at far distances (horizon) or high altitudes. However, this limitation also allows for more advanced shading at a cheap price (simple single pass shader, no impostors needed).

  1. Drag the DistanceCloud entity to the level.
  2. Scale it with the Scale tool to about 100, then assign one of the distance cloud materials (all materials with distance clouds shader in materials/clouds folder can be used). Distance clouds are 2D, so they should be placed far away or above so that the player does not see that they are flat.
  3. Finally, to place a cloud with nice shading, drag a Volume entity to the level.
  4. With the VolumeObjectFile set to Libs/Clouds/Default.xml, select a cloud material in the Material Editor. Make sure that the Shader is set to VolumeObject. The cloud can now be scaled as needed.

The difference between the normal 3D cloud and a VolumeObject is that volume object clouds have correct self shadowing. Do not place too many volume object clouds because they greatly affect performance.

Note

If you assign a new material, ensure that it has the correct shader applied. For volume clouds, you have to assign the VolumeObject shader.

How it works...

There are four distinct ways to visualize clouds in the engine. This is because there is often the requirement for a mix of types to achieve certain effects or some types might not have to be used. The four ways of achieving clouds in CryENGINE are:

  • Painting clouds into a skybox, which is very controllable for the artists. The method is good for slower graphic cards as it only requires texturing, but it only allows static images and it will not react when changing the time of day.
  • The imposter clouds are rendered in 3D to intermediate textures and requires update after every few frames. They are slower and consume more or less memory at runtime depending on the view.
  • The distance clouds which render faster, have constant memory requirements, support time of day shading, but are not real 3D. A viewer that went near to them would see that they are a flat plane.
  • The volume clouds are true 3D; they even intersect with the geometry correctly and have a constant memory requirement. The downside to rendering them is that they are slower than the rest and in comparison look a bit blurry.

There's more...

You may want to have cloud shadows simulated in your level, which you can find out how to do next.

Cloud shadows

Clouds don't cast real-time shadows, but there can be a (moveable) texture used that is casted on the entire level, creating the illusion that clouds cast shadows.

Use the default cloud shadow texture (textures | clouds | cloud_pattern.dds) and adjust it in Photoshop by painting it white in the areas where you don't want to have shadows.

Set the Cloud Shadow Speed to 0.001 for fast moving clouds and 0.0005 for normal clouds.

See also

  • Continue to the next chapter,Chapter 5, Basic Artificial Intelligence to make it rain in your level, which will compliment the placement of clouds.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.37.196