Class FrameGraphMinMaxReducerTask
Hierarchy (View Summary)
- FrameGraphTask
- FrameGraphMinMaxReducerTask
Constructors
constructor
-
new FrameGraphMinMaxReducerTask(
name: string,
frameGraph: FrameGraph,
): FrameGraphMinMaxReducerTaskCreates a min/max reduction task.
Parameters
- name: string
The name of the task.
- frameGraph: FrameGraph
The frame graph to add the task to.
Returns FrameGraphMinMaxReducerTask
- name: string
Properties
Optionaldependencies
The (texture) dependencies of the task (optional).
depth Redux
Whether to ignore the clear value of a depth-as-color texture during reduction (default: false). For normalized view or forward screen depth, the clear value is 1; for view depth or reverse screen depth, it is 0. Always enabled for a depth/stencil attachment, which stores screen depth.
depth Texture Type
The type of depth values stored in the source texture when depthRedux is true (default: normalized view depth).
on After Task Execute
An observable that is triggered after the task is executed.
on Before Task Execute
An observable that is triggered before the task is executed.
on Textures Allocated Observable
An observable that is triggered after the textures have been allocated.
Readonlyoutput Texture
The 1x1 RG texture containing the minimum in red and maximum in green.
source Texture
The 2D texture to reduce. If generated by a graph task, that task must execute before this one. WebGPU can reduce the depth aspect of a single-sampled depth/stencil attachment; backbuffer depth, stencil-only attachments and integer color formats are not supported.
texture Type
The type of the intermediate and output textures (default: half float). Supported types are FLOAT, HALF_FLOAT, and UNSIGNED_BYTE.
Accessors
disabled
-
get disabled(): boolean
Whether the task is disabled.
Returns boolean
-
set disabled(value: boolean): void
Parameters
- value: boolean
Returns void
name
-
get name(): string
The name of the task.
Returns string
-
set name(value: string): void
Parameters
- value: string
Returns void
on After Reduction Performed
-
get onAfterReductionPerformed(): any
Observable triggered after the reduced texture has been read back. With depthRedux enabled, an empty or equal-valued depth range falls back to [0, 1].
Returns any
passes
-
get passes(): IFrameGraphPass[]
Gets the passes of the task.
Returns IFrameGraphPass[]
passes Disabled
-
get passesDisabled(): IFrameGraphPass[]
Gets the disabled passes of the task.
Returns IFrameGraphPass[]
wait For Readback
-
get waitForReadback(): boolean
Wait for WebGPU texture readback before notifying observers (default: false). This delays the notification; it does not block graph execution.
Returns boolean
-
set waitForReadback(value: boolean): void
Parameters
- value: boolean
Returns void
Methods
dispose
-
Disposes of the task.
Returns void
get Class Name
-
Gets the current class name
Returns string
the class name
init Async
-
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.
is Ready
-
Checks if the task is ready to be executed.
Returns boolean
True if the task is ready to be executed, else false.
record
-
Records the task in the frame graph. Use this function to add content (render passes, ...) to the task.
Returns void
Task which computes the minimum and maximum values in the red channel of a frame graph texture, or in the depth aspect of a WebGPU depth/stencil attachment. Set sourceTexture to a handle from an earlier task (for example, a geometry renderer's geometryNormViewDepthTexture) to reuse its output without rendering another depth map. The reduction is performed on each graph execution.