API

Interface DepthOfFieldPostProcessTaskConfig

Configuration for createDepthOfFieldPostProcessTask.

Models Babylon.js's FrameGraphDepthOfFieldTask + ThinDepthOfFieldEffect: a circle-of-confusion pass feeds a stack of CoC-weighted separable blurs, which are merged back over the sharp image for a physically-plausible depth-of-field effect.

interface DepthOfFieldPostProcessTaskConfig {
    alphaMode?: PostProcessAlphaMode;
    blurLevel?: DepthOfFieldBlurLevel;
    camera: Camera;
    clear?: boolean;
    depthNotNormalized?: boolean;
    depthTexture: RenderTarget;
    focalLength?: number;
    focusDistance?: number;
    fStop?: number;
    lensSize?: number;
    name?: string;
    sourceSamplingMode?: PostProcessSamplingMode;
    sourceTexture: RenderTarget;
    targetTexture?: RenderTarget | null;
    viewport?: NormalizedViewport | null;
}

Hierarchy (View Summary)

Index

Blur quality. Default DepthOfFieldBlurLevel.Low.

camera: Camera

Camera used to read minZ/maxZ when the depth is normalized.

clear?: boolean

Clear the target before drawing. Set false when several viewport passes share a target.

depthNotNormalized?: boolean

When true the depth texture stores camera-space depth (0..maxZ).

depthTexture: RenderTarget

Depth texture. With depthNotNormalized it stores camera-space (view) depth; otherwise normalized [0,1] view depth.

focalLength?: number

Focal length of the camera in scene units / 1000. Default 50.

focusDistance?: number

Distance from the camera to focus on, in scene units / 1000. Default 2000.

fStop?: number

F-Stop of the camera. Default 1.4.

lensSize?: number

Max lens size in scene units / 1000. Default 50.

name?: string
sourceSamplingMode?: PostProcessSamplingMode
sourceTexture: RenderTarget
targetTexture?: RenderTarget | null
viewport?: NormalizedViewport | null