Class DepthOfFieldEffect
Hierarchy (View Summary)
- PostProcessRenderEffect
- DepthOfFieldEffect
Constructors
constructor
-
new DepthOfFieldEffect(
sceneOrEngine: any,
depthTexture: Nullable<RenderTargetTexture>,
blurLevel?: DepthOfFieldEffectBlurLevel,
pipelineTextureType?: number,
blockCompilation?: boolean,
depthNotNormalized?: boolean,
): DepthOfFieldEffectCreates a new instance DepthOfFieldEffect
Parameters
- sceneOrEngine: any
The scene or engine 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.
- blurLevel: DepthOfFieldEffectBlurLevel = DepthOfFieldEffectBlurLevel.Low
- pipelineTextureType: number = 0
The type of texture to be used when performing the post processing.
- blockCompilation: boolean = false
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)
- depthNotNormalized: boolean = false
If the depth from the depth texture is already normalized or if the normalization should be done at runtime in the shader (default: false)
Returns DepthOfFieldEffect
- sceneOrEngine: any
Accessors
depth Texture
-
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
- value: RenderTargetTexture
Returns void
focal Length
-
get focalLength(): number
Returns number
-
set focalLength(value: number): void
The focal the length of the camera used in the effect in scene units/1000 (eg. millimeter)
Parameters
- value: number
Returns void
focus Distance
-
get focusDistance(): number
Returns number
-
set focusDistance(value: number): void
Distance away from the camera to focus on in scene units/1000 (eg. millimeter). (default: 2000)
Parameters
- value: number
Returns void
f Stop
-
get fStop(): number
Returns number
-
set fStop(value: number): void
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 void
is Supported
-
get isSupported(): boolean
Checks if all the post processes in the effect are supported.
Returns boolean
lens Size
-
get lensSize(): number
Returns number
-
set lensSize(value: number): void
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 void
Methods
dispose Effects
-
Disposes each of the internal effects for a given camera.
Parameters
- camera: Camera
The camera to dispose the effect on.
Returns void
- camera: Camera
get Class Name
-
Get the current class name of the current effect
Returns string
"DepthOfFieldEffect"
get Post Processes
-
Gets a list of the post processes contained in the effect.
Parameters
Optionalcamera: CameraThe camera to get the post processes on.
Returns Nullable<PostProcess[]>
The list of the post processes in the effect.
The depth of field effect applies a blur to objects that are closer or further from where the camera is focusing.