Create realistic clouds (volumetric clouds)
Volumetric clouds are interactable clouds that can render shadows, and receive fog and volumetric light.
Refer to Understand clouds for more information about clouds in the High Definition Render Pipeline (HDRP).
Enabling Volumetric Clouds
The Volumetric Clouds Volume component override controls settings relevant to rendering volumetric clouds.
To use this feature in your Scene, you must first enable it for your project and then enable it for your Cameras. To enable features in your project, you use the HDRP Asset and to enable features for your Cameras, you use Frame Settings. You can enable features either for all Cameras, using the Default Frame Settings, or for specific Cameras, by overriding each Camera's individual Frame Settings.
In your [HDRP Asset](HDRP Asset) go to Lighting > Volumetrics > Volumetric Clouds.
In your Frame Settings go to Lighting > Volumetric Clouds.
Using Volumetric Clouds
Volumetric Clouds uses the Volume framework, so to enable and modify Volumetric Clouds properties, you must add a Volumetric Clouds override to a Volume in your Scene. To add a Volumetric Clouds override to a Volume:
- In the Scene or Hierarchy view, select a GameObject that contains a Volume component to view it in the Inspector.
- In the Inspector, navigate to Add Override > Sky and click on Volumetric Clouds.
Note: When editing Volumetric Cloud properties in the Editor, set Temporal Accumulation Factor to a lower value. This allows you to see changes instantly, rather than blended over time.
Refer to the Volumetric Clouds Volume Override reference for more information.
API
To access and control this override at runtime, use the Volume scripting API. Because of how the Volume system works, you edit properties in a different way to standard Unity components. There are also other nuances to be aware of too, such as each property has an overrideState. This indicates to the Volume system whether to use the property value you set, or use the default value stored in the Volume Profile. For information on how to use the API correctly, see Volume scripting API.