Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DepthOfFieldEffect

The depth of field effect applies a blur to objects that are closer or further from where the camera is focusing.

Hierarchy

Index

Constructors

constructor

  • Creates a new instance DepthOfFieldEffect

    Parameters

    • scene: Scene

      The scene the effect belongs to.

    • depthTexture: Nullable<RenderTargetTexture>

      The depth texture of the scene to compute the circle of confusion.This must be set in order for this to function but may be set after initialization if needed.

    • Optional blurLevel: DepthOfFieldEffectBlurLevel
    • Optional pipelineTextureType: number

      The type of texture to be used when performing the post processing.

    • Optional blockCompilation: boolean

      If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)

    Returns DepthOfFieldEffect

Accessors

depthTexture

  • Depth texture to be used to compute the circle of confusion. This must be set here or in the constructor in order for the post process to function.

    Parameters

    Returns any

fStop

  • get fStop(): number
  • set fStop(value: number): any
  • F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)

    Returns number

  • F-Stop of the effect's camera. The diameter of the resulting aperture can be computed by lensSize/fStop. (default: 1.4)

    Parameters

    • value: number

    Returns any

focalLength

  • get focalLength(): number
  • set focalLength(value: number): any
  • The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter)

    Returns number

  • The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter)

    Parameters

    • value: number

    Returns any

focusDistance

  • get focusDistance(): number
  • set focusDistance(value: number): any
  • Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)

    Returns number

  • Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)

    Parameters

    • value: number

    Returns any

isSupported

  • get isSupported(): boolean
  • Checks if all the post processes in the effect are supported.

    Returns boolean

lensSize

  • get lensSize(): number
  • set lensSize(value: number): any
  • Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.

    Returns number

  • Max lens size in scene units/1000 (eg. millimeter). Standard cameras are 50mm. (default: 50) The diameter of the resulting aperture can be computed by lensSize/fStop.

    Parameters

    • value: number

    Returns any

Methods

disposeEffectsSearch playground for disposeEffects

  • disposeEffects(camera: Camera): void
  • Disposes each of the internal effects for a given camera.

    Parameters

    • camera: Camera

      The camera to dispose the effect on.

    Returns void

getClassNameSearch playground for getClassName

  • getClassName(): string
  • Get the current class name of the current effect

    Returns string

    "DepthOfFieldEffect"

getPostProcessesSearch playground for getPostProcesses

  • Gets a list of the post processes contained in the effect.

    Parameters

    • Optional camera: Camera

      The camera to get the post processes on.

    Returns Nullable<Array<PostProcess>>

    The list of the post processes in the effect.

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method