Skip to content

Game.Prefabs.Climate.VolumetricCloudsProperties

Assembly: Assembly-CSharp
Namespace: Game.Prefabs.Climate

Type: Class

Base: OverrideablePropertiesComponent

Summary:
Component used by weather prefabs to expose and synchronize HDRP Volumetric Clouds parameters as overrideable, editor/script-accessible parameters. It appears in the Unity Component menu under "Weather/" (see ComponentMenu attribute) and copies its parameter values into the VolumetricClouds volume component when binding. This lets the game's weather system or custom mods configure volumetric cloud appearance (altitudes, density, shape, erosion, ambient occlusion, multi-scattering, etc.) via a centralized, overrideable properties component.


Fields

  • public MinFloatParameter m_BottomAltitude = new MinFloatParameter(1200f, 0.01f)
    The base altitude (in meters) of the bottom of the volumetric cloud layer. Default: 1200. Minimum allowed value handled by MinFloatParameter.

  • public MinFloatParameter m_AltitudeRange = new MinFloatParameter(2000f, 100f)
    Vertical thickness (range) of the cloud layer above the bottom altitude. Default: 2000. Minimum allowed value 100.

  • public ClampedFloatParameter m_DensityMultiplier = new ClampedFloatParameter(0.4f, 0f, 1f)
    Global multiplier for cloud density (0..1). Default: 0.4.

  • public AnimationCurveParameter m_DensityCurve = new AnimationCurveParameter(new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.15f, 1f), new Keyframe(1f, 0.1f)))
    Vertical density profile curve across the cloud layer. Default curve peaks near the bottom fraction and tails off toward the top.

  • public ClampedFloatParameter m_ShapeFactor = new ClampedFloatParameter(0.9f, 0f, 1f)
    Controls the overall cloud shape/detail blending (0..1). Default: 0.9.

  • public Vector3Parameter m_ShapeOffset = new Vector3Parameter(Vector3.zero)
    3D offset to apply to the procedural shape/noise sampling for cloud patterns.

  • public ClampedFloatParameter m_ErosionFactor = new ClampedFloatParameter(0.8f, 0f, 1f)
    Controls erosion (breakup) amount in the cloud shapes (0..1). Default: 0.8.

  • public ClampedFloatParameter m_ErosionOcclusion = new ClampedFloatParameter(0.1f, 0f, 1f)
    Occlusion factor used by erosion calculations (0..1). Default: 0.1.

  • public AnimationCurveParameter m_ErosionCurve = new AnimationCurveParameter(new AnimationCurve(new Keyframe(0f, 1f), new Keyframe(0.1f, 0.9f), new Keyframe(1f, 1f)))
    Curve describing how erosion affects density across the cloud layer.

  • public AnimationCurveParameter m_AmbientOcclusionCurve = new AnimationCurveParameter(new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.25f, 0.4f), new Keyframe(1f, 0f)))
    Curve controlling ambient occlusion contribution across the cloud height.

  • public ClampedFloatParameter m_MultiScattering = new ClampedFloatParameter(0.5f, 0f, 1f)
    Controls multi-scattering intensity in volumetric clouds (0..1). Default: 0.5.

Properties

  • None (this component exposes its parameters as public fields derived from VolumeParameter types).

Constructors

  • public VolumetricCloudsProperties()
    Default constructor — no explicit custom initialization beyond field defaults declared inline.

Methods

  • protected override void OnBindVolumeProperties(Volume volume) : System.Void
    Binds (synchronizes) this component's parameters to the HDRP VolumetricClouds volume component. Implementation details:
  • Retrieves or creates a VolumetricClouds component on the provided Volume using VolumeHelper.GetOrCreateVolumeComponent.
  • Assigns the values from the VolumetricClouds volume component to this component's parameter fields (the code assigns the component's parameters into the fields, effectively making this component reflect the volume's parameters).
  • Finally, forces the cloud preset to Custom by calling component.m_CloudPreset.Override(VolumetricClouds.CloudPresets.Custom). Notes for modders:
  • The method ensures the weather prefab's overrideable parameters and the actual VolumetricClouds volume component stay in sync when the engine binds volume properties.
  • Because the fields are VolumeParameter-derived types, they can be configured in inspector, animated, or overridden by the game's volume/override system.

Usage Example

// Example: set up default parameter values in a custom prefab/initializer.
// The engine will call OnBindVolumeProperties and copy these into the actual Volume component.
protected override void OnCreate()
{
    base.OnCreate();

    // Telemetry of defaults (you can change these to create different cloud looks)
    m_BottomAltitude.value = 1400f;
    m_AltitudeRange.value = 1800f;
    m_DensityMultiplier.value = 0.6f;
    m_ShapeFactor.value = 0.85f;
    m_ShapeOffset.value = new Vector3(100f, 0f, 50f);
    m_ErosionFactor.value = 0.7f;
    m_MultiScattering.value = 0.55f;
}

{{ Additional notes for modders: - This component is intended to be used on WeatherPrefab objects (see ComponentMenu attribute). The game or your custom weather systems typically call the volume binding lifecycle; you rarely need to call OnBindVolumeProperties manually. - When changing parameter values at runtime, ensure the weather/volume binding step runs (or re-trigger volume refresh) so the VolumetricClouds volume component receives the updated parameters. - The parameters here are VolumeParameter-derived types; use the .value property to read/write numeric and Vector3 values, and assign AnimationCurveParameter.curve for curve changes if needed. }}