docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class VolumeParameter<T>

    A generic implementation of VolumeParameter. Custom parameters should derive from this class and implement their own behavior.

    Inheritance
    object
    VolumeParameter
    VolumeParameter<T>
    APVLeakReductionModeParameter
    AnimationCurveParameter
    BoolParameter
    ColorParameter
    CubemapParameter
    FloatParameter
    FloatRangeParameter
    IntParameter
    LayerMaskParameter
    MaterialParameter
    NoInterpClampedFloatParameter
    NoInterpClampedIntParameter
    NoInterpColorParameter
    NoInterpCubemapParameter
    NoInterpFloatParameter
    NoInterpFloatRangeParameter
    NoInterpIntParameter
    NoInterpMaxFloatParameter
    NoInterpMaxIntParameter
    NoInterpMinFloatParameter
    NoInterpMinIntParameter
    NoInterpRenderTextureParameter
    NoInterpTextureParameter
    NoInterpVector2Parameter
    NoInterpVector3Parameter
    NoInterpVector4Parameter
    ObjectParameter<T>
    RenderTextureParameter
    Texture2DParameter
    Texture3DParameter
    TextureCurveParameter
    TextureParameter
    Vector2Parameter
    Vector3Parameter
    Vector4Parameter
    Implements
    ICloneable
    IEquatable<VolumeParameter<T>>
    Inherited Members
    VolumeParameter.k_DebuggerDisplay
    VolumeParameter.m_OverrideState
    VolumeParameter.overrideState
    VolumeParameter.GetValue<T>()
    VolumeParameter.OnEnable()
    VolumeParameter.OnDisable()
    VolumeParameter.IsObjectParameter(Type)
    VolumeParameter.Release()
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Rendering
    Assembly: Unity.RenderPipelines.Core.Runtime.dll
    Syntax
    [Serializable]
    public class VolumeParameter<T> : VolumeParameter, ICloneable, IEquatable<VolumeParameter<T>>
    Type Parameters
    Name Description
    T

    The type of value to hold in this parameter.

    Remarks

    T should a serializable type. Due to limitations with the serialization system in Unity, you should not use this class directly to declare parameters in a VolumeComponent. Instead, 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:

    using UnityEngine.Rendering;
    
    [Serializable]
    public sealed class MyFloatParameter : VolumeParameter<float>
    {
        public MyFloatParameter(float value, bool overrideState = false)
            : base(value, overrideState) { }
    
        public sealed override void Interp(float from, float to, float t)
        {
            m_Value = from + (to - from) * t;
        }
    }

    Constructors

    Name Description
    VolumeParameter()

    Creates a new VolumeParameter<T> instance.

    VolumeParameter(T, bool)

    Creates a new VolumeParameter<T> instance.

    Fields

    Name Description
    m_Value

    The value stored and serialized by this parameter.

    Properties

    Name Description
    value

    The value that this parameter stores.

    Methods

    Name Description
    Clone()

    Clones the current instance of the VolumeParameter

    Equals(object)

    Determines whether two object instances are equal.

    Equals(VolumeParameter<T>)

    Checks if this parameter is equal to another.

    GetHashCode()

    Returns a hash code for the current object.

    Interp(T, T, float)

    Interpolates two values using a factor t.

    Override(T)

    Sets the value for this parameter and sets its override state to true.

    SetValue(VolumeParameter)

    Sets the value of this parameter to the value in parameter.

    ToString()

    Returns a string that represents the current object.

    Operators

    Name Description
    operator ==(VolumeParameter<T>, T)

    Compares the value in a parameter with another value of the same type.

    explicit operator T(VolumeParameter<T>)

    Explicitly downcast a VolumeParameter<T> to a value of type T.

    operator !=(VolumeParameter<T>, T)

    Compares the value store in a parameter with another value of the same type.

    Extension Methods

    AnalyticsUtils.ToNestedColumnWithDefault<T>(T, T, bool)
    AnalyticsUtils.ToNestedColumn<T>(T, bool)

    See Also

    VolumeParameter
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)