Class DepthOfField | Post Processing | 2.3.0
docs.unity3d.com
    Show / Hide Table of Contents

    Class DepthOfField

    This class holds settings for the Depth of Field effect.

    Inheritance
    Object
    PostProcessEffectSettings
    DepthOfField
    Inherited Members
    PostProcessEffectSettings.active
    PostProcessEffectSettings.enabled
    PostProcessEffectSettings.SetAllOverridesTo(Boolean, Boolean)
    PostProcessEffectSettings.GetHash()
    Namespace: UnityEngine.Rendering.PostProcessing
    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
    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
    public FloatParameter focalLength
    Field Value
    Type Description
    FloatParameter

    focusDistance

    The distance to the point of focus.

    Declaration
    [Min(0.1F)]
    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")]
    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
    Boolean

    true if the effect is currently enabled and supported

    Overrides
    PostProcessEffectSettings.IsEnabledAndSupported(PostProcessRenderContext)
    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