Controlling Volumetric Clouds at Runtime

I was able to figure out how to get it running with help from the Volumetric Cloud Forum Thread [here]( Volumetric Clouds page-11#post-7726815)

Here is a simple script that lets you change the Cloud Presets.

Created buttons for each Preset and the buttons just call the functions below.

using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;

public class CloudControl : MonoBehaviour
{
    [SerializeField] VolumeProfile volumeProfile;
    VolumetricClouds vClouds;

    public void Sparse()
    {
        if (volumeProfile.TryGet<VolumetricClouds>(out vClouds))
        {
            vClouds.cloudPreset.value = VolumetricClouds.CloudPresets.Sparse;
            Debug.Log(vClouds.cloudPreset);
        }
   
    }
    public void Cloudy()
    {
        if (volumeProfile.TryGet<VolumetricClouds>(out vClouds))
        {
            vClouds.cloudPreset.value = VolumetricClouds.CloudPresets.Cloudy;
            Debug.Log(vClouds.cloudPreset);
        }

    }
    public void Overcast()
    {
        if (volumeProfile.TryGet<VolumetricClouds>(out vClouds))
        {
            vClouds.cloudPreset.value = VolumetricClouds.CloudPresets.Overcast;
            Debug.Log(vClouds.cloudPreset);
        }

    }
    public void Stormy()
    {
        if (volumeProfile.TryGet<VolumetricClouds>(out vClouds))
        {
            vClouds.cloudPreset.value = VolumetricClouds.CloudPresets.Stormy;
            Debug.Log(vClouds.cloudPreset);
        }

    }

}
1 Like