API

Class FrameGraphDepthOfFieldTask

Task which applies a depth of field effect.

Hierarchy (View Summary)

Index
camera: Camera

The camera used to render the scene.

dependencies?: Set<FrameGraphTextureHandle>

The (texture) dependencies of the task (optional).

depthOfField: ThinDepthOfFieldEffect

The depth of field effect.

depthSamplingMode: any = Constants.TEXTURE_BILINEAR_SAMPLINGMODE

The sampling mode to use for the depth texture.

depthTexture: FrameGraphTextureHandle

The depth texture to use for the depth of field effect. Should store camera space depth (Z coordinate).

hdr: boolean

Whether the depth of field effect is applied on HDR textures. When true, the depth of field effect will use a higher precision texture format (half float or float). Else, it will use unsigned byte.

onAfterTaskExecute: Observable<FrameGraphTask> = ...

An observable that is triggered after the task is executed.

onBeforeTaskExecute: Observable<FrameGraphTask> = ...

An observable that is triggered before the task is executed.

onTexturesAllocatedObservable: Observable<FrameGraphRenderContext> = ...

An observable that is triggered after the textures have been allocated.

outputTexture: FrameGraphTextureHandle

The output texture of the depth of field effect.

sourceSamplingMode: any = Constants.TEXTURE_BILINEAR_SAMPLINGMODE

The sampling mode to use for the source texture.

sourceTexture: FrameGraphTextureHandle

The source texture to apply the depth of field effect on.

targetTexture?: any

The target texture to render the depth of field effect to.

  • This function is called once after the task has been added to the frame graph and before the frame graph is built for the first time. This allows you to initialize asynchronous resources, which is not possible in the constructor.

    Returns Promise<unknown>

    A promise that resolves when the initialization is complete.