docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class DepthOfField

    This class holds settings for the Depth of Field effect.

    Inheritance
    object
    Object
    ScriptableObject
    PostProcessEffectSettings
    DepthOfField
    Inherited Members
    PostProcessEffectSettings.active
    PostProcessEffectSettings.enabled
    PostProcessEffectSettings.SetAllOverridesTo(bool, bool)
    PostProcessEffectSettings.GetHash()
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Rendering.PostProcessing
    Assembly: Unity.Postprocessing.Runtime.dll
    Syntax
    [Serializable]
    public sealed class DepthOfField : PostProcessEffectSettings

    Fields

    aperture

    The ratio of the aperture (known as f-stop or f-number). The smaller the value is, the shallower the depth of field is.

    Declaration
    [Range(0.05, 32)]
    [Tooltip("Ratio of aperture (known as f-stop or f-number). The smaller the value is, the shallower the depth of field is.")]
    public FloatParameter aperture
    Field Value
    Type Description
    FloatParameter

    focalLength

    The distance between the lens and the film. The larger the value is, the shallower the depth of field is.

    Declaration
    [Range(1, 300)]
    [Tooltip("Distance between the lens and the film. The larger the value is, the shallower the depth of field is.")]
    public FloatParameter focalLength
    Field Value
    Type Description
    FloatParameter

    focusDistance

    The distance to the point of focus.

    Declaration
    [Min(0.1)]
    [Tooltip("Distance to the point of focus.")]
    public FloatParameter focusDistance
    Field Value
    Type Description
    FloatParameter

    kernelSize

    The convolution kernel size of the bokeh filter, which determines the maximum radius of bokeh. It also affects the performance (the larger the kernel is, the longer the GPU time is required).

    Declaration
    [DisplayName("Max Blur Size")]
    [Tooltip("Convolution kernel size of the bokeh filter, which determines the maximum radius of bokeh. It also affects performances (the larger the kernel is, the longer the GPU time is required).")]
    public KernelSizeParameter kernelSize
    Field Value
    Type Description
    KernelSizeParameter

    Methods

    IsEnabledAndSupported(PostProcessRenderContext)

    Returns true if the effect is currently enabled and supported.

    Declaration
    public override bool IsEnabledAndSupported(PostProcessRenderContext context)
    Parameters
    Type Name Description
    PostProcessRenderContext context

    The current post-processing render context

    Returns
    Type Description
    bool

    true if the effect is currently enabled and supported

    Overrides
    PostProcessEffectSettings.IsEnabledAndSupported(PostProcessRenderContext)
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)