WoLD Archives Search About Contact

World of Level Design

Tutorials to Becoming the Best Level Designer and Game Environment Artist (since 2008)

UE4: Step-by-Step to Creating Your First Volumetric Cloud Material

Category: UE4
February 16, 2021

Volumetric Cloud actor uses a Simple Volumetric Cloud Material.

Although the name says simple, in reality it is not.

It's difficult to reverse engineer without comments and deeper understanding of material functions and what they do.

The most important part of how the Volumetric Clouds look comes from the Material, which is then passed on to a Material Instance.

If you take a look at the Material Instance properties, none of them make sense. Sure, you can tweak and change all the settings to see what they do but you are changing values arbitrarily without knowing what's going on behind the scenes in the Material.

I decided to figure out how to create my own Volumetric Cloud material so I can understand what is happening, what the parameters do and most importantly to have more control over the cloud shape.

After two weeks of hitting my head against the wall, I was finally able to figure it out.

So, in this tutorial I show you how to create your own Volumetric Cloud material, step-by-step.

Volumetric Cloud Analysis Tutorial

Make sure you've seen this tutorial first where I analyze and breakdown the Volumetric Clouds and what makes them work.

Video Tutorial

Overview of Volumetric Cloud Material

Here is the final material setup from the completed tutorial. This is the best starting point for the Volumetric Cloud Material. It will give you everything you need to create different cloud shapes, control the cloud's appearance and to expand on with advanced functionality.

Click on the image to see larger size (opens in a new tab)

Show Engine, Plugin Content and Enable Volumetric Plugin

Make sure you enable Volumetric Plugin, Show Engine and Plugin folders. I showed how to do that in this tutorial. This will give you additional Volume Textures to use if you need it.

Step 1: Create a Material and Material Instance

Create a new Material.

Add/Import > Material:

Name it anything you want.

Right-Click on the Material and choose Create Material Instance:

I left the name as-is with additional extension of _INST that UE4 gives me.

Assign the Material Instance onto the Volumetric Cloud in the Details panel under Material property:

Step 2: Material Domain and Blend Mode

Open up the Material and select the Main Node. The only one that's there in the editor right now. In Details panel set the following:

  • Material Domain: Volume
  • Blend Mode: Additive

Step 3: Albedo Color and Emissive Color

To get things started you only need a Constant3Vector converted to a parameter and connected into Albedo input. Then also use a Constant1Vector set to 0 and connect it into Emissive Color:

This is the basic setup for Albedo you need. There are some fancy and advanced techniques you can do with combining Cloud Color but at this point you don't need that. Simple Constant3Vector will work well.

Step 4: 2D Mask Texture

You are now ready to begin setting up Volumetric Cloud functionality.

First you need Cloud Texture Mask, which is a simple 2D image.

Texture Mask will determine the cloud's shape and where in the sky it will appear. With this Texture Mask alone you will be able to generate Volumetric Clouds.

The texture I will use for this tutorial example is Greyscale found in Engine Content > Functions > Engine_MaterialFunctions02 > ExampleContent:

Ryan Brucks, principal Technical Artist at Epic Games used a similar texture in one of his streams. I really liked how easily it communicated what the 2d texture mask does, so I will use a similar approach.

There is nothing special about this texture. It's a simple, small 128x128x greyscale image:

  • Compressing Settings: Masks (no sRGB)
  • sRGB: disabled
  • X-axis and Y-axis Tiling Method: Wrap
  • Use Legacy Gamma: enabled

Create the following setup:

  • Mask Scale parameter: 40
  • Mutiply B: 100,000
  • Component Mask: R,G
  • Cloud Bias parameter: 0.2

Reason we Multiply B with 100,000:

  • Absolute World Position uses centimeters but Clouds use kilometers
  • Multiplying Mask Scale with 100,000 gives us whole values to adjust in the Mask Scale parameter rather than having to use fractions
  • UE4 doesn't allow you to input a fraction of a number beyound 6 digits (meaning you can't use .0000001) and without Multiplying by 100,000 we would have to
  • Convert Texture Sample Mask to a Parameter, this way we can change the Texture in the Material Instance

Here is the Mask Texture setup connected into Extinction. You can see the shape of the cloud it produces based on the texture.

Step 5: Add Cloud Density

Now we need Cloud Density controls. This will make the clouds transparent or opaque.

The setup:

  • Cloud Density parameter: 0.1
  • Divide B: 100

If you didn't Divide by 100 before Multiplying with the Texture Mask setup then Density would NOT do anything.

Density results:

Step 6: Detail Volume Texture

To create detail in the cloud's shape, you need a Volume Texture and combine it with Mask Texture setup.

Creating your own Volume Textures is an involved process but luckily you don't have to. UE4 comes with a set of Volume Textures to use.

You will find Volume Textures to use in:

  • Engine Content > EngineSky > Volumetric Clouds

  • Volumetrics Content > Content > VolumeTextures > Textures

The Volume Texture I will use for this example is T_VolumeNoiseShape128 found in Engine Content > EngineSky > Volumetric Clouds.

The Setup is similar to the Mask Texture one:

  • Cloud Scale parameter: 10
  • Mutiply B: 100,000
  • Cloud Detail parameter: 0.5
  • Subtract B: 1.0

Then Add Texture Mask and Volume Texture setup:

Result. Make sure to adjust Cloud Detail and Cloud Density parameters to get good looking Clouds:

Update 2D Texture Mask

Now that you have Cloud shape and detail, you can change the 2D Texture Mask to another texture.

For this example I will use LowResBlurredNoise and OffsetNoiseDistanceFields_ForNormals. Ignore the name of these textures. Both are simple texture masks used within UE4 for specific reasons but it is still a texture mask.

  • LowResBlurredNoise
  • Engine Content > Functions > Engine_MaterialFunctions02 > ExampleContent > Textures

  • OffsetNoiseDistanceFields_ForNormals
  • Engine Content > Functions > Engine_MaterialFunctions02 > ExampleContent > Textures

For both Texture Masks I had to adjust the Material Instance parameters to make the Clouds look good. You can use any Texture Mask you want that's available in UE4 or create your own.

Here is the result of changed Texture Mask:

Lessons on Texture Masks for Clouds

Important things I learned about using 2d texture masks for clouds:

  • You can literally use any mask you want BUT you do have to adjust Mask Scale, Cloud Scale and Cloud Detail to get good results
  • The values you adjust these to all depend on the size of the texture mask, sometimes Mask Scale has to be increased by a lot due to the texture size

Advanced Tip: you can pack 3 texture masks into a single texture. Disable "sRGB" and change Compression Settings to Mask (no sRGB). Then use Component Mask, convert it to a Parameter where and choose which channel you want to use in the Material Instance for different Cloud Shapes.

Update Cloud Volume Texture

In addition to changing a Texture Mask, you can change Volume Texture for different clouds detail.

Creating your own Volume textures is an involved process but you don't need to, just use the ones that are provided in UE4.

Engine Content > EngineSky > Volumetric Clouds:

  • T_VolumeNoiseShape128
  • T_VolumeNoiseShape64
  • T_VolumeNoiseErosion32

Volumetrics Content > Content > VolumeTextures > Textures:

  • VT_CurlNoise
  • VT_Lightning
  • VT_PerlinWorley_Balanced
  • VT_Voronoi
  • VT_Voronoi_Simple

Step 7: Falloff

Let's introduce Falloff that will allow you change upper and lower shape of the cloud.

Here is the setup:

  • Cloud Sample Attribute: gives access to normalized height within the cloud layer and can be used to map falloff functions
  • 1Minus nodes
  • Custom node
  • Falloff Upper parameter: 25
  • Falloff Lower parameter: 25
  • Cloud Bias parameter: 0.2

The Custom node properties are:

  • Code: return exp(-x);
  • Output Type: CMOT Float 1
  • Description: exp(-x)
  • Input Name for 0: x

Connect this Falloff Function setuip into Subtract B in the 2D Texture Mask setup, replacing the previous Cloud Bias:

Step 8: Volumetric Advanced Output

Volumetric Advanced Material Output: provides control over a set of cloud parameters that affect the volume material applied to the Volumetric Cloud when added to a material graph.

Basically, it will control how light will scatter through the clouds.

By simply inserting the Volumetric Advanced Output and without changing anything, you will notice a difference how your Volumetric Clouds look.

First thing you want to change or at least know about is Multi Scattering Approximation Octave Count. Select Volumetric Advanced Output node and in Details panel change it to 1 or keep it at 0.

  • For gameplay keep it at 0
  • For environment art scenes without gameplay increase it to 1

I found changing this to 1 does produce better results but 0 looks good too.

Here is a technical explanation of Multi-Scattering from Epic Games:

"Light rays that travel through a volume have the potential to scatter on particles within the volume before reaching your eye, or a camera sensor. This effect of light is called multiple scattering, and it is what defines the distinct appearance of clouds. In a cloud, the droplets that make up the cloud usually lead to an Albedo that is close to a value of 1, meaning that light is almost never absorbed within the volume. Light that is not absorbed passes through the volume making the scattering effect very complex in the process. The multiple scattering effect of the participating media affects light travel through the cloud volume; it's what makes them look bright while also appearing very thick. The complexity of multiple scattering in real-time rendering is solved by using an approximation of realistic scattering by tracing multiple octaves (or steps) of light transmittance in the volume material. The Volumetric Advanced Material Output expression enables you to set the number of octaves used along with the amount of multiple scattering contribution, occlusion, and eccentricity that happens." - Source

Volumetric Advanced Output has a settings you can change within the Details panel. You can expose them in the Material Instance by setting up Scalar parameters like so. All values below are default:

For explanation of each input and what they do see this technical doc page.

Step 9: Move Clouds with Manual Offset

There are 2 ways to move clouds across the sky.

  • Manual
  • Automatic (animate to move on their own)

The manual way is great for static scenes.

This Offset introduces manual way to move the 2D Texture Mask on X and Y (RG).

  • Constant3Vector converted to a parameter: 0,0,0,0
  • Subtract node, placed between Divide and Mask (R,G)

Now in material Instance, change X and Y values to see the clouds move.

You can also use the same setup for Cloud Volume Texture. Just rename the Offset parameter if you are going to use one for Texture Mask and one for Cloud Volume Texture.

Step 10: Animated Clouds

Second way is to make Volumetric Clouds always move on their own. Great for gameplay or environment scenes where you want to show movement.

Here is the setup for 2D Texture Mask:

  • Multiply Time with Constant3Vector converted to a parameter: 0.01,0.01,0,0
  • Add between Divide and Mask (R,G)

You can also use the same setup for Cloud Volume Texture. Just rename the WindVector parameter if you are going to use one for Texture Mask and one for Cloud Volume Texture setup.

Step 11: Expand from Here

By itself, this should be enough to get you started for most clouds.

But of course, there is a lot more that you could do and it all depends on your experience with Material Editor and UE4.

Take a look at the examples from:

  • Engine Content > EngineSky > Volumetric Clouds folder
  • Volumetric Content > Content and Tools folders

Then the examples to build on top of your existing setup.

Resources

Volumetric Clouds Epic Games Doc

Volumetric Clouds Epic Games Reference

Building Worlds In ‘Fortnite' With Unreal Engine (Clouds Section Starts at 28:06)

Making Volumetric Clouds in Unreal engine 4.26

Next Tutorial

UE4: Recreate the Dynamic Time of Day Template Level - Why You Should and How-To

UE4 Fundamentals Vol.1 Tutorial Course

These Quick Tips are just a small part of a very complex Unreal Engine. Get started with UE4 as an absolute beginner by downloading "UE4 Fundamentals Vol.1 - The Essential Beginner's Guide" tutorial course.

SUBSCRIBE & GET FREE UE4 PDF GUIDE

Subscribe to receive NEW/UPDATED and FREE "UE4 Beginner's Quick Start Guide" PDF (150+ pages).

Subscribe and Get Free UE4 PDF Guide

Visit this page for more info about the guide...


Follow WoLD




UE4 LANDSCAPE ESSENTIALS


BEGINNER COURSE TO LEARN UE4


LEARN THE PREPRODUCTION PROCESS


ABOUT WoLD & ALEXG

About World of Level Design

My name is Alex Galuzin. I am self-taught level designer, game environment artist and the creator of World of Level Design.com. I've learned everything I know from personal experimentation and decades of being around various online communities of fellow environment artist and level designers. On World of Level Design you will find tutorials to make you become the best level designer and game environment artist.

Read More »


Home Terms of Use/Trademarks/Disclaimers Privacy Policy Donate About Contact

All content on this website is copyrighted ©2008-2021 World of Level Design LLC by Alex Galuzin. All rights reserved.
Duplication and distribution is illegal and strictly prohibited.

World of Level Design LLC is an independent company. World of Level Design website, its tutorials and products are not endorsed, sponsored or approved by any mentioned companies on this website in any way. All content is based on my own personal experimentation, experience and opinion. World of Level Design™ and 11 Day Level Design™ are trademarks of Alex Galuzin.

Template powered by w3.css