UE5.2: Volumetric Cloud Shader
Shader-based volumetric cloud
Experimenting the shader-based volumetric cloud. It is indeed very impressive! By leveraging the volumetric cloud nodes based on UE's built-in Ray March functions, UE team eliminates the need for additional code to create dense volume clouds, thus embracing an exceptionally lightweight and optimizable workflow for realistic clouds. The following video demonstrates the potential of this technique. Furthermore, you can enhance the sky further by decorating it with custom volume textures or 2D textures, enabling full control over the shader within the material."
How do I create the volumetric clouds?
So, first step, go inside material and see in the details panel, switch the Material Domain to Volume.
Set Lighting Mode -> Volumetric NonDirectional
Checkup Used with Volumetric Cloud
And there is a basic workflow like these images follow up: Volumetric Advanced Input / Output. And here is the magic, in the Volumetric Advanced Output / ConservartiveDensity. This pin gives us the power to draw the clouds volume in VolumetricCloud Actor like we draw some clouds on a 3d canvas.
Here's the material input part - Volumetric Advanced Input
Here's the material output part - Volumetric Advanced Output
3d volume open up a free space for any cloud inputs
Add layers into the volume space, and here as example, I have Top Cloud, Hero Cloud, Bottom Cloud.
Simply use add node to the cloud layer data and link to Conservative Density.
Result
Once you have all the layers altitude setup the cloud layer would be at the right altitude in the 3d volume, the clouds can be overlay it will not add additional cost to the performance.
The Key Shader nodes reveal
Let's take a look at the most interesting nodes - Volume Texture Cloud Layer
Here are 3 things required to have in all cloud layers
Get the correct scale for the cloud size (Default is unit is 100000 cm)
R, G is used for X axis and Y axis in the volume space, B is used for Z axis which refers to the height.
Extra cloud details noise for additional details.
Here's the Hero Cloud layer nodes
Here's another example of the volumetric cloud material.
Solutions Comparison
There are already many ways to achieve volumetric clouds in UE5.2, VDB plugin, Heterogenous Volume (Used in Niagara Volume), Sparse Volume (Also use vdb volume), here's my opinions about these tech.
VDB plugin, difficult to optimize, extremely expensive.
Heterogenous volume is very limited in Lumen environment project at the moment and difficult to implement widely. Better to use local cloud.
Sparse volume is relatively light compared to VDB plugin but still very expensive to volumetric cloud (Only shader)
Last Update: April 3, 2024
Software: Unreal Engine 5.2
OS: Windows 10
Specs: RTX 3080, AMD 3900x, 64GB RAM
Reference: