Skip to content

Game.Prefabs.Climate.ShadowsMidtonesHighlightsProperties

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

Type: class

Base: OverrideablePropertiesComponent

Summary:
Component used by Weather prefabs to expose and override HDRP's Shadows / Midtones / Highlights color grading parameters via prefab properties. This class maps to the HDRP ShadowsMidtonesHighlights volume component and provides Vector4 and MinFloat parameters that can be edited per-prefab or bound from a Volume. It is registered in the component menu under "Weather/" and is intended to be used with WeatherPrefab-derived assets.


Fields

  • public Vector4Parameter m_Shadows
    Holds the shadows color/curve parameter (Vector4). Default: new Vector4(1f, 1f, 1f, 0f). Maps to ShadowsMidtonesHighlights.shadows on the volume component.

  • public Vector4Parameter m_Midtones
    Holds the midtones color/curve parameter (Vector4). Default: new Vector4(1f, 1f, 1f, 0f). Maps to ShadowsMidtonesHighlights.midtones.

  • public Vector4Parameter m_Highlights
    Holds the highlights color/curve parameter (Vector4). Default: new Vector4(1f, 1f, 1f, 0f). Maps to ShadowsMidtonesHighlights.highlights.

  • public MinFloatParameter m_ShadowsStart
    Minimum/start position for the shadows range. Default: new MinFloatParameter(0f, 0f). Maps to ShadowsMidtonesHighlights.shadowsStart.

  • public MinFloatParameter m_ShadowsEnd
    End position for the shadows range. Default: new MinFloatParameter(0.3f, 0f). Maps to ShadowsMidtonesHighlights.shadowsEnd.

  • public MinFloatParameter m_HighlightsStart
    Start position for the highlights range. Default: new MinFloatParameter(0.55f, 0f). Maps to ShadowsMidtonesHighlights.highlightsStart.

  • public MinFloatParameter m_HighlightsEnd
    End position for the highlights range. Default: new MinFloatParameter(1f, 0f). Maps to ShadowsMidtonesHighlights.highlightsEnd.

Notes: - The header attributes in the class ("Shadow Limits", "Highlight Limits") are only for inspector grouping and do not affect runtime behavior. - Vector4Parameter and MinFloatParameter are HDRP/Volume parameter wrappers; their actual editable values are accessed via the .value property.

Properties

  • None. (All exposed settings in this component are public fields based on VolumeParameter types.)

Constructors

  • public ShadowsMidtonesHighlightsProperties()
    No explicit constructor is declared in the class; the default parameterless constructor is used. The field initializers provide the default VolumeParameter values.

Methods

  • protected override void OnBindVolumeProperties(Volume volume) : System.Void
    Binds this component's fields to the given Volume's ShadowsMidtonesHighlights component. Implementation overview:
  • Retrieves or creates the ShadowsMidtonesHighlights volume component instance on the supplied Volume using VolumeHelper.GetOrCreateVolumeComponent.
  • Copies references from the volume component to this component's fields:
    • m_Shadows <- component.shadows
    • m_Midtones <- component.midtones
    • m_Highlights <- component.highlights
    • m_ShadowsStart <- component.shadowsStart
    • m_ShadowsEnd <- component.shadowsEnd
    • m_HighlightsStart <- component.highlightsStart
    • m_HighlightsEnd <- component.highlightsEnd
  • After binding, changes to these fields will reflect or read the bound VolumeParameter instances.

Usage Example

// When a Weather prefab needs to bind volume values, the component will copy
// the Shadows/Midtones/Highlights parameters from a Volume's ShadowsMidtonesHighlights
// component. After binding, you can read or modify the parameter values:

protected override void OnBindVolumeProperties(Volume volume)
{
    base.OnBindVolumeProperties(volume);

    // Example: modify the bound shadows color (Vector4Parameter exposes .value)
    // m_Shadows is a Vector4Parameter; set a slightly bluish shadow tint:
    m_Shadows.value = new Vector4(0.9f, 0.95f, 1f, 0f);

    // Example: tighten the shadows range
    m_ShadowsStart.value = 0f;
    m_ShadowsEnd.value = 0.25f;
}

Additional notes: - This component is marked with [ComponentMenu("Weather/", typeof(WeatherPrefab))], so it is intended to be used within WeatherPrefab assets and appears under the Weather menu in the component picker. - The component is effectively a bridge between editable prefab properties and HDRP volume components for color grading adjustments specific to weather/climate prefabs.