API

Class FrameGraphPostProcessTask

Task which applies a post process.

Hierarchy (View Summary)

Index
dependencies?: Set<FrameGraphTextureHandle>

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

depthAttachmentTexture?: any

The depth attachment texture to use for the post process (optional). Note that a post-process task never writes to the depth buffer: attaching a depth texture is only useful if you want to test against the depth/stencil aspect or write to the stencil buffer.

depthReadOnly: boolean = false

If true, the depth attachment will be read-only. This means that the post process will not write to the depth buffer. Setting depthReadOnly and stencilReadOnly to true is useful when you want to also be able to bind this same depth/stencil attachment to a shader. Note that it will only work in WebGPU, as WebGL does not support read-only depth/stencil attachments.

depthTest: boolean = true

If depth testing should be enabled (default is true).

disableColorWrite: boolean = false

If true, color write will be disabled when applying the post process. This means that the post process will not write to the color buffer.

drawBackFace: boolean = false

If true, the post process will be generated by a back face full-screen quad (CW order).

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.

outputDepthAttachmentTexture: FrameGraphTextureHandle

The output depth attachment texture. This texture will point to the same texture than the depthAttachmentTexture property if it is set. Note, however, that the handle itself will be different!

outputTexture: FrameGraphTextureHandle

The output texture of the post process.

postProcess: EffectWrapper

The post process to apply.

sourceSamplingMode: any = Constants.TEXTURE_BILINEAR_SAMPLINGMODE

The sampling mode to use for the source texture.

sourceTexture?: any

The source texture to apply the post process on. It's allowed to be undefined if the post process does not require a source texture. In that case, targetTexture must be provided.

stencilReadOnly: boolean = false

If true, the stencil attachment will be read-only. This means that the post process will not write to the stencil buffer. Setting depthReadOnly and stencilReadOnly to true is useful when you want to also be able to bind this same depth/stencil attachment to a shader. Note that it will only work in WebGPU, as WebGL does not support read-only depth/stencil attachments.

stencilState?: any

The stencil state to use for the post process (optional).

targetTexture?: any

The target texture to render the post process to. If not supplied, a texture with the same configuration as the source texture will be created.

viewport?: any

The viewport to use when applying the post process. If set to null, the currently active viewport is used. If undefined (default), the viewport is reset to a full screen viewport before applying the post process.

  • 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.

  • Records the task in the frame graph. Use this function to add content (render passes, ...) to the task.

    Parameters

    • skipCreationOfDisabledPasses: boolean = false

      If true, the disabled passe(s) won't be created.

    • OptionaladditionalExecute: (context: FrameGraphRenderContext) => void
    • OptionaladditionalBindings: (context: FrameGraphRenderContext) => void

    Returns FrameGraphRenderPass