Best way to create massive volumetric clouds

Hello there !

I’m looking for advice on the best way to create large, volumetric, realistic clouds for a game set in the atmosphere of Jupiter.
I looked at Visual Effect Graph a bit but it doesn’t look really appropriate.

With HDRP.

thank you

I have a bit of knowledge in this area…

You’ll need to write a shader that raymarches a combination of 2D and 3D noise textures for the cloud shapes, along with volumetric techniques to handle the lighting and shadowing. (Eg beer-lambert law, henyen-greenstein phase function)

You’ll also need an atmospheric scattering system to make the scene itself look good. Volumetric clouds look terrible without a matching sky, ambient lighting, and fog/aerial perspective.

Realtime volumetric clouds is a huge area of research in computer graphics, and has only recently become feasible in a few AAA titles.

Unless you have several years of shader and graphics programming experience, your only likely solutions are to find something on the asset store, or github.

A couple of decent looking github solutions I’ve found:

(Note this one requires a paid license for commercial use)

Otherwise, if you want to implement it yourself, these are some of the main links I’ve been referencing for my own work:

I’ve been working on volumetric clouds + atmospheric scattering for a year or so, this screenshot is how it looks in my current project. (Also pictured: Custom Scriptable Rendering Pipeline, Ocean, Virtual Terrain Texturing, Volumetric lighting, GPU driven foliage rendering)

8 Likes

thank you for your precise and complete answer!

Can you tell me if the technique used by this youtuber (

) is the one you describe to me? I think so

I find it extremely complex … do you think it’s possible to have a similar rendering with other methods? And if not, tutorials to get started in graphic programming?

Yep, that video is using raymarching.

Here’s the general technique In a nutshell:

In a shader:
You pick a start and end height for the cloud “layer”. This can be between two planes, but for a large world you’ll want to do a ray-sphere intersection to make clouds descend in to the horizon.

Then you calculate a ray from the camera, and intersect it with your cloud start and end heights. (Ray-plane and ray sphere intersections are pretty easy to find)

The shader then steps along this ray using a for-loop.
At each loop iteration, you sample a tiling 3D noise texture, and sum the density, weighed by the distance between each sample. (Numerical integration)

Multiply the final result by a density value and you have your cloud opacity.

Most techniques will use a combination of noise textures, one is large and low-frequency to give shape to the clouds.
The other is smaller, and high-frequency, and is used to “erode” detail from the edges of the cloud shapes for detail.

This is enough to give you an opacity for your clouds, but it will not have any lighting and look very flat.

To calculate lighting is a lot more expensive:
For each sample you take in the loop above, you then calculate another ray along the light direction.

You then have to take several more samples along this second ray, and sum the densities to give you the amount of light reaching your current point. This is then multiplied by the density of the current ray, and a phase function such as Henyey-Greenstein. It takes the angle/dot-product between the camera and light direction, and a controllable anisotropy parameter between -1 and 1 to control forward vs backwards scattering.

It’s pretty expensive, so downsampled render targets, dithering and Temporal subsampling are usually used to help with performance. (These have their own issues such as blurring the result though, so it’s tricky to get right)

As for learning to write shaders, the following link is a pretty good start. Volumetric clouds are definitely one of the more complex techniques to master though:

1 Like

If you need complete control over the shapes of your clouds and don’t need to go through the clouds then using meshes could do it

I have a fork of this repo with a branch ported to PP stack v2 for the built-in pipeline. Might be more useful to port to the HDRP post processing stack if you go this route.
https://github.com/GuitarBro/VolumeCloud/tree/StackV2

1 Like

Will you fork with URP?

No, I don’t use URP. Feel free to try to do it yourself if you wish, supposedly the PPSv2 and URP PP stack are pretty similar, so it may just be some api changes.