Class FrameGraphMeshBlendingTask
Hierarchy (View Summary)
- FrameGraphPostProcessTask
- FrameGraphMeshBlendingTask
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
new FrameGraphMeshBlendingTask(
name: string,
frameGraph: FrameGraph,
thinPostProcess?: ThinMeshBlendingPostProcess,
): FrameGraphMeshBlendingTaskConstructs a mesh-blending task.
Parameters
- name: string
The name of the task.
- frameGraph: FrameGraph
The frame graph this task belongs to.
OptionalthinPostProcess: ThinMeshBlendingPostProcessThe thin post process to use. A new one is created when omitted.
Returns FrameGraphMeshBlendingTask
- name: string
Properties
Optionalbase Color Texture
Optional linear base-color/albedo geometry texture aligned with SceneColor.
When omitted, shadow estimation is compiled out.
camera
Camera used to project radii and reconstruct view-space positions.
Optionaldependencies
The (texture) dependencies of the task (optional).
Optionaldepth Attachment Texture
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.
depth Read Only
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.
depth Test
If depth testing should be enabled (default is true).
depth Texture
The view-depth or screen-depth texture aligned with the packed tag texture.
disable Color Write
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.
draw Back Face
If true, the post process will be generated by a back face full-screen quad (CW order).
mesh Blend Tag Texture
The packed R8UI mesh-blending tag texture used to locate seams.
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 Depth Attachment Texture
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!
Readonlyoutput Texture
The output texture of the post process.
Readonlypost Process
The thin post process containing the shared quality variant and blend configuration.
source Sampling Mode
The sampling mode to use for the source texture.
Optionalsource Texture
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.
stencil Read Only
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.
Optionalstencil State
The stencil state to use for the post process (optional).
Optionaltarget Texture
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.
Optionalviewport
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.
Accessors
alpha Mode
-
get alphaMode(): number
The alpha mode to use when applying the post process (default is ALPHA_DISABLE).
Returns number
-
set alphaMode(value: number): void
Parameters
- value: number
Returns void
debug Mode
-
Gets or sets the compiled debug visualization.
Returns MeshBlendDebugMode
-
Parameters
- value: MeshBlendDebugMode
Returns void
depth Type
-
Gets or sets the representation stored in depthTexture.
Returns MeshBlendDepthType
-
Parameters
- value: MeshBlendDepthType
Returns void
disabled
-
get disabled(): boolean
Whether the task is disabled.
Returns boolean
-
set disabled(value: boolean): void
Parameters
- value: boolean
Returns void
draw Wrapper
-
get drawWrapper(): DrawWrapper
The draw wrapper used by the post process
Returns DrawWrapper
name
-
get name(): string
The name of the task.
Returns string
-
set name(value: string): void
Parameters
- value: string
Returns void
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[]
quality
-
Gets or sets the compile-time mesh-blending quality variant.
Returns MeshBlendQuality
-
Parameters
- value: MeshBlendQuality
Returns void
radius Classes
-
Gets the four configurable radius definitions indexed by packed radius class.
Returns MeshBlendRadiusDefinitions
slope Factor
-
get slopeFactor(): number
Gets or sets the contact-slope narrowing factor. A value of 1 disables narrowing.
Returns number
-
set slopeFactor(value: number): void
Parameters
- value: number
Returns void
Methods
configure
-
Applies the same configuration accepted by the classic MeshBlendingPostProcess wrapper.
Parameters
Optionaloptions: IMeshBlendConfigurationValues to apply. Omitted values retain their current settings.
Returns void
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 any
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.
Parameters
- skipCreationOfDisabledPasses: boolean = false
If true, the disabled passe(s) won't be created.
Returns FrameGraphRenderPass
- skipCreationOfDisabledPasses: boolean = false
Frame-graph task which visually blends SceneColor across validated contacts between opaque or alpha-tested meshes.
This WebGL2 and WebGPU task uses the same effect and configuration as MeshBlendingPostProcess. It does not modify geometry, collision queries, depth, normals, or shadows. All source and geometry textures must have matching physical dimensions and sample counts. Transparent rendering is caller-controlled; overlapping transparent surfaces can make SceneColor inconsistent with the single-layer geometry inputs. On WebGL2, rendering transparent meshes into the integer tag attachment requires per-target blend parameters.
See
https://playground.babylonjs.com/?version=preview#O05LI8#6