using System; namespace UnityEngine.Rendering.HighDefinition { /// /// A volume component that holds settings for the Shadows, Midtones, Highlights effect. /// [Serializable, VolumeComponentMenu("Post-processing/Shadows, Midtones, Highlights")] [SupportedOnRenderPipeline(typeof(HDRenderPipelineAsset))] [HDRPHelpURL("Post-Processing-Shadows-Midtones-Highlights")] public sealed class ShadowsMidtonesHighlights : VolumeComponent, IPostProcessComponent { /// /// Controls the darkest portions of the render. /// public Vector4Parameter shadows = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f)); /// /// Controls the power function that handles mid-range tones. /// public Vector4Parameter midtones = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f)); /// /// Controls the lightest portions of the render. /// public Vector4Parameter highlights = new Vector4Parameter(new Vector4(1f, 1f, 1f, 0f)); /// /// Sets the start point of the transition between shadows and midtones. /// [Header("Shadow Limits")] [Tooltip("Sets the start point of the transition between shadows and midtones.")] public MinFloatParameter shadowsStart = new MinFloatParameter(0f, 0f); /// /// Sets the end point of the transition between shadows and midtones. /// [Tooltip("Sets the end point of the transition between shadows and midtones.")] public MinFloatParameter shadowsEnd = new MinFloatParameter(0.3f, 0f); /// /// Sets the start point of the transition between midtones and highlights. /// [Header("Highlight Limits")] [Tooltip("Sets the start point of the transition between midtones and highlights.")] public MinFloatParameter highlightsStart = new MinFloatParameter(0.55f, 0f); /// /// Sets the end point of the transition between midtones and highlights. /// [Tooltip("Sets the end point of the transition between midtones and highlights.")] public MinFloatParameter highlightsEnd = new MinFloatParameter(1f, 0f); /// /// Tells if the effect needs to be rendered or not. /// /// true if the effect should be rendered, false otherwise. public bool IsActive() { var defaultState = new Vector4(1f, 1f, 1f, 0f); return shadows != defaultState || midtones != defaultState || highlights != defaultState; } ShadowsMidtonesHighlights() => displayName = "Shadows, Midtones, Highlights"; } }