Class ParameterOverride<T> | Post Processing | 2.3.0
docs.unity3d.com
    Show / Hide Table of Contents

    Class ParameterOverride<T>

    The base typed class for all parameter override types.

    Inheritance
    Object
    ParameterOverride
    ParameterOverride<T>
    AmbientOcclusionModeParameter
    AmbientOcclusionQualityParameter
    BoolParameter
    ColorParameter
    EyeAdaptationParameter
    FloatParameter
    GradingModeParameter
    IntParameter
    KernelSizeParameter
    ScreenSpaceReflectionPresetParameter
    ScreenSpaceReflectionResolutionParameter
    SplineParameter
    TextureParameter
    TonemapperParameter
    Vector2Parameter
    Vector3Parameter
    Vector4Parameter
    VignetteModeParameter
    Inherited Members
    ParameterOverride.overrideState
    ParameterOverride.GetValue<T>()
    ParameterOverride.OnEnable()
    ParameterOverride.OnDisable()
    Namespace: UnityEngine.Rendering.PostProcessing
    Syntax
    [Serializable]
    public class ParameterOverride<T> : ParameterOverride
    Type Parameters
    Name Description
    T

    The type of value to store in this ParameterOverride

    Remarks

    Due to limitations with the serialization system in Unity you shouldn't use this class directly. Use one of the pre-flatten types (like FloatParameter or make your own by extending this class.

    Examples

    This sample code shows how to make a custom parameter holding a float.

    [Serializable]
    public sealed class FloatParameter : ParameterOverride<float>
    {
        public override void Interp(float from, float to, float t)
        {
            value = from + (to - from) * t;
        }
    }

    Constructors

    ParameterOverride()

    Creates a ParameterOverride with a default value and overrideState set to false.

    Declaration
    public ParameterOverride()

    ParameterOverride(T)

    Creates a ParameterOverride with a given value and overrideState set to false.

    Declaration
    public ParameterOverride(T value)
    Parameters
    Type Name Description
    T value

    The value to set this parameter to

    ParameterOverride(T, Boolean)

    Creates a ParameterOverride with a given value and override state.

    Declaration
    public ParameterOverride(T value, bool overrideState)
    Parameters
    Type Name Description
    T value

    The value to set this parameter to

    Boolean overrideState

    The override state for this value

    Fields

    value

    The value stored in this parameter.

    Declaration
    public T value
    Field Value
    Type Description
    T

    Methods

    GetHash()

    Returns the computed hash code for this parameter.

    Declaration
    public override int GetHash()
    Returns
    Type Description
    Int32

    A computed hash code

    Overrides
    ParameterOverride.GetHash()

    Interp(T, T, Single)

    Interpolates between two values given an interpolation factor t.

    Declaration
    public virtual void Interp(T from, T to, float t)
    Parameters
    Type Name Description
    T from

    The value to interpolate from

    T to

    The value to interpolate to

    Single t

    An interpolation factor (generally in range [0,1])

    Remarks

    By default this method does a "snap" interpolation, meaning it will return the value to if t is higher than 0, from otherwise.

    Override(T)

    Sets the value for this parameter to x and mark the override state to true.

    Declaration
    public void Override(T x)
    Parameters
    Type Name Description
    T x

    Operators

    Implicit(ParameterOverride<T> to T)

    Implicit conversion between ParameterOverride<T> and its value type.

    Declaration
    public static implicit operator T(ParameterOverride<T> prop)
    Parameters
    Type Name Description
    ParameterOverride<T> prop

    The parameter to implicitly cast

    Returns
    Type Description
    T

    A value of type .

    In This Article
    • Constructors
      • ParameterOverride()
      • ParameterOverride(T)
      • ParameterOverride(T, Boolean)
    • Fields
      • value
    • Methods
      • GetHash()
      • Interp(T, T, Single)
      • Override(T)
    • Operators
      • Implicit(ParameterOverride<T> to T)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023