Class DepthOfFieldSettings

Settings that control the depth-of-field effect.

Constructors

  • Parameters

    • OptionalbokehShape: ResourceHandle<Texture>
    • OptionalisEnabled: boolean
    • Optionaltype: EnumValue<DepthOfFieldType, number>
    • OptionalfocalRange: number
    • OptionalnearTransitionRange: number
    • OptionalfarTransitionRange: number
    • OptionalnearBlurAmount: number
    • OptionalfarBlurAmount: number
    • OptionalmaxBokehSize: number
    • OptionaladaptiveColorThreshold: number
    • OptionaladaptiveRadiusThreshold: number
    • OptionalisUsingBokehOcclusion: boolean
    • OptionalocclusionDepthRange: number

    Returns DepthOfFieldSettings

Properties

_adaptiveColorThreshold: number
_adaptiveRadiusThreshold: number
_bokehShape: ResourceHandle<Texture>
_farBlurAmount: number
_farTransitionRange: number
_focalRange: number
_isEnabled: boolean
_isUsingBokehOcclusion: boolean
_maxBokehSize: number
_nearBlurAmount: number
_nearTransitionRange: number
_occlusionDepthRange: number
_type: EnumValue<DepthOfFieldType, number>

Accessors

  • get adaptiveColorThreshold(): number
  • Determines the maximum color difference between surrounding pixels allowed (as a sum of all channels) before higher fidelity sampling is triggered. Increasing this value can improve performance as less higher fidelity samples will be required, but may decrease quality of the effect. Only relevant when using Bokeh depth of field.

    Returns number

  • set adaptiveColorThreshold(value): void
  • Parameters

    • value: number

    Returns void

  • get adaptiveRadiusThreshold(): number
  • Determines the minimum circle of confusion size before higher fidelity sampling is triggered. Small values trigger high fidelity sampling because they can otherwise produce aliasing, and they are small enough so they don't cost much. Increasing this value can improve performance as less higher fidelity samples will be required, but may decrease quality of the effect. Only relevant when using Bokeh depth of field.

    Returns number

  • set adaptiveRadiusThreshold(value): void
  • Parameters

    • value: number

    Returns void

  • get farBlurAmount(): number
  • Determines the amount of blur to apply to fully unfocused objects that are farther away from camera than the in-focus zone. Set to zero to disable far-field blur. Only relevant for Gaussian depth of field.

    Returns number

  • set farBlurAmount(value): void
  • Parameters

    • value: number

    Returns void

  • get farTransitionRange(): number
  • Determines the size of the range within which objects transition from focused to fully unfocused, at the far plane. Only relevant for Gaussian and Bokeh depth of field. In world units (meters).

    Returns number

  • set farTransitionRange(value): void
  • Parameters

    • value: number

    Returns void

  • get focalRange(): number
  • Range within which the objects remain fully in focus. This range is applied relative to the focal distance. This parameter should usually be non-zero when using the Gaussian depth of field effect. When using other types of depth-of-field you can set this to zero for a more physically-based effect, or keep it non-zero for more artistic control. In world units (meters).

    Returns number

  • set focalRange(value): void
  • Parameters

    • value: number

    Returns void

  • get isEnabled(): boolean
  • Enables or disables the depth of field effect.

    Returns boolean

  • set isEnabled(value): void
  • Parameters

    • value: boolean

    Returns void

  • get isUsingBokehOcclusion(): boolean
  • Set to true if Bokeh flare should use soft depth testing to ensure they don't render on top of foreground geometry. This can help reduce background bleeding into the foreground, which can be especially noticeable if the background is much brighter than the foreground. Use OcclusionDepthRange to tweak the effect.

    Returns boolean

  • set isUsingBokehOcclusion(value): void
  • Parameters

    • value: boolean

    Returns void

  • get maxBokehSize(): number
  • Determines the maximum size of the blur kernel, in percent of view size. Larger values cost more performance. Only relevant when using Bokeh depth of field.

    Returns number

  • set maxBokehSize(value): void
  • Parameters

    • value: number

    Returns void

  • get nearBlurAmount(): number
  • Determines the amount of blur to apply to fully unfocused objects that are closer to camera than the in-focus zone. Set to zero to disable near-field blur. Only relevant for Gaussian depth of field.

    Returns number

  • set nearBlurAmount(value): void
  • Parameters

    • value: number

    Returns void

  • get nearTransitionRange(): number
  • Determines the size of the range within which objects transition from focused to fully unfocused, at the near plane. Only relevant for Gaussian and Bokeh depth of field. In world units (meters).

    Returns number

  • set nearTransitionRange(value): void
  • Parameters

    • value: number

    Returns void

  • get occlusionDepthRange(): number
  • Range in world units over which range to fade out Bokeh flare influence. Influence of the flare will be faded out as the depth difference between the flare's origin pixel and the destination pixel grows larger. Only relevant if BokehOcclusion is turned on.

    Returns number

  • set occlusionDepthRange(value): void
  • Parameters

    • value: number

    Returns void

Methods