API

Class FrameGraphBloomTask

Task which applies a bloom render effect.

Hierarchy (View Summary)

Index
  • Constructs a new bloom task.

    Parameters

    • name: string

      Name of the task.

    • frameGraph: FrameGraph

      The frame graph this task is associated with.

    • weight: number = 0.25

      Weight of the bloom effect.

    • kernel: number = 64

      Kernel size of the bloom effect.

    • threshold: number = 0.2

      Threshold of the bloom effect.

    • hdr: boolean = false

      Whether the bloom effect is HDR.

    • bloomScale: number = 0.5

      The scale of the bloom effect. This value is multiplied by the source texture size to determine the bloom texture size.

    Returns FrameGraphBloomTask

bloom: ThinBloomEffect

The bloom effect to apply.

dependencies?: Set<FrameGraphTextureHandle>

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

hdr: boolean

Whether the bloom effect is HDR. When true, the bloom 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 bloom effect.

sourceSamplingMode: any = Constants.TEXTURE_BILINEAR_SAMPLINGMODE

The sampling mode to use for the source texture.

sourceTexture: FrameGraphTextureHandle

The source texture to apply the bloom effect on.

targetTexture?: any

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

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