Class FrameGraphGeometryRendererTask
Hierarchy (View Summary)
- FrameGraphObjectRendererTask
- FrameGraphGeometryRendererTask
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
new FrameGraphGeometryRendererTask(
name: string,
frameGraph: FrameGraph,
scene: Scene,
options?: any,
existingObjectRenderer?: any,
): FrameGraphGeometryRendererTaskConstructs a new geometry renderer task.
Parameters
- name: string
The name of the task.
- frameGraph: FrameGraph
The frame graph the task belongs to.
- scene: Scene
The scene the frame graph is associated with.
Optionaloptions: anyThe options of the object renderer.
OptionalexistingObjectRenderer: anyAn existing object renderer to use (optional). If provided, the options parameter will be ignored.
Returns FrameGraphGeometryRendererTask
- name: string
Properties
Optionaldependencies
The (texture) dependencies of the task (optional).
depth Test
If depth testing should be enabled (default is true).
Optionaldepth Texture
The depth attachment texture where the objects will be rendered (optional).
depth Write
If depth writing should be enabled (default is true).
disable Shadows
If shadows should be disabled (default is false).
dont Render When Material Depth Write Is Disabled
Indicates if a mesh shouldn't be rendered when its material has depth write disabled (default is true).
Readonlygeometry Albedo Texture
The albedo output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!
Readonlygeometry Irradiance Texture
The irradiance output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!
Readonlygeometry Linear Velocity Texture
The linear velocity output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions! Built-in CPU/GPU particles write neutral velocity (0, 0); their motion is not represented.
Readonlygeometry Local Position Texture
The position (in local space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!
Readonlygeometry Mesh Blend Tag Texture
The packed, single-sample R8UI mesh-blending tag output texture for WebGL2 and WebGPU.
Opaque, alpha-tested, and caller-selected transparent meshes are supported.
Readonlygeometry Norm View Depth Texture
The normalized depth (in view space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions! The normalization is (d - near) / (far - near), where d is the depth value in view space and near and far are the near and far planes of the camera.
Readonlygeometry Object Id Texture
The object ID output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!
RGBA unsigned byte textures store 24-bit IDs, while RED unsigned byte textures store 8-bit IDs.
Decode RED values with round(value * 255.0).
Readonlygeometry Reflectivity Texture
The reflectivity output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!
Readonlygeometry Screen Depth Texture
The depth (in screen space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!
Readonlygeometry Velocity Texture
The velocity output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions! Built-in CPU/GPU particles write neutral velocity (0.5, 0.5); their motion is not represented.
Readonlygeometry View Depth Texture
The depth (in view space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!
Readonlygeometry View Normal Texture
The normal (in view space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!
Readonlygeometry World Normal Texture
The normal (in world space, encoded from [-1, 1] to [0, 1]) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!
Readonlygeometry World Position Texture
The position (in world space) output texture. Will point to a valid texture only if that texture has been requested in textureDescriptions!
is Main Object Renderer
Sets this property to true if this task is the main object renderer of the frame graph. It will help to locate the main object renderer in the frame graph when multiple object renderers are used. This is useful for the inspector to know which object renderer to use for additional rendering features like wireframe rendering or frustum light debugging. It is also used to determine the main camera used by the frame graph: this is the camera used by the main object renderer.
object List
The list of objects to render.
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 Texture
The output depth attachment texture. This texture will point to the same texture than the depthTexture property if it is set. Note, however, that the handle itself will be different!
Readonlyoutput Texture
The output texture. This texture will point to the same texture than the targetTexture property. Note, however, that the handle itself will be different!
resolve MSAA Colors
If true, targetTexture will be resolved at the end of the render pass, if this/these texture(s) is/are MSAA (default: true)
resolve MSAA Depth
If true, depthTexture will be resolved at the end of the render pass, if this texture is provided and is MSAA (default: false).
samples
The number of samples to use for the output textures (default is 1).
Optionalshadow Generators
The shadow generators used to render the objects (optional).
size
The size of the output textures (default is 100% of the back buffer texture size).
size Is Percentage
Whether the size is a percentage of the back buffer size (default is true).
target Texture
The target texture(s) where the objects will be rendered.
texture Descriptions
The list of texture descriptions used by the geometry renderer task.
Accessors
camera
-
get camera(): Camera
Gets or sets the camera used to render the objects.
Returns Camera
-
set camera(camera: Camera): void
Parameters
- camera: Camera
Returns void
disabled
-
get disabled(): boolean
Whether the task is disabled.
Returns boolean
-
set disabled(value: boolean): void
Parameters
- value: boolean
Returns void
disable Depth Pre Pass
-
get disableDepthPrePass(): boolean
Indicates whether the depth pre-pass is disabled (default is true). Materials that require depth pre-pass (Material.needDepthPrePass == true) don't work with the geometry renderer, that's why this setting is true by default. However, if the geometry renderer doesn't generate any geometry textures but only renders to the main target texture, then depth pre-pass can be enabled.
Returns boolean
-
set disableDepthPrePass(value: boolean): void
Parameters
- value: boolean
Returns void
disable Image Processing
-
get disableImageProcessing(): boolean
If image processing should be disabled (default is false). false means that the default image processing configuration will be applied (the one from the scene)
Returns boolean
-
set disableImageProcessing(value: boolean): void
Parameters
- value: boolean
Returns void
enable Bounding Box Rendering
-
get enableBoundingBoxRendering(): boolean
Enables the rendering of bounding boxes for meshes (still subject to Mesh.showBoundingBox or scene.forceShowBoundingBoxes). Default is true.
Returns boolean
-
set enableBoundingBoxRendering(value: boolean): void
Parameters
- value: boolean
Returns void
enable Outline Rendering
-
get enableOutlineRendering(): boolean
Enables the rendering of outlines/overlays for meshes (still subject to Mesh.renderOutline/Mesh.renderOverlay). Default is true.
Returns boolean
-
set enableOutlineRendering(value: boolean): void
Parameters
- value: boolean
Returns void
excluded Skinned Mesh From Velocity Texture
-
get excludedSkinnedMeshFromVelocityTexture(): AbstractMesh[]
Gets the list of excluded meshes from the velocity texture.
Returns AbstractMesh[]
force Layer Mask Check
-
get forceLayerMaskCheck(): boolean
Forces checking the layerMask property even if a custom list of meshes is provided (ie. if renderList is not undefined). Default is true.
Returns boolean
-
set forceLayerMaskCheck(value: boolean): void
Parameters
- value: boolean
Returns void
mesh Blend Tag Provider
-
get meshBlendTagProvider(): any
Provides the packed mesh-blending tag written for each rendered mesh.
Tags must be 0 or contain a group ID between 1 and 63 in their low six bits. Tag 0 disables mesh blending. By default, meshes use their
meshBlendingTagproperty. Instances and thin instances use the source mesh tag. The provider runs in the render hot path and receives the source mesh for instanced draws. It should avoid allocations and return a consistent value for a mesh during a render.Returns any
-
set meshBlendTagProvider(value: any): void
Parameters
- value: any
Returns void
name
-
get name(): string
Gets or sets the name of the task.
Returns string
-
set name(value: string): void
The name of the task.
Parameters
- value: string
Returns void
object Id Provider
-
get objectIdProvider(): any
Provides the object ID written for each rendered mesh.
IDs must be integers between 0 and 0xFFFFFF for RGBA textures, or between 0 and 0xFF for RED textures. ID 0 is reserved for background or excluded meshes. By default, meshes use their unique ID. Instances use the ID of their source mesh. Default IDs are only stable for the lifetime of the current scene and should not be persisted. When using a RED texture, provide a custom ID if mesh unique IDs can exceed 0xFF. The provider runs in the render hot path and may be called multiple times for the same mesh in a frame.
Returns any
-
set objectIdProvider(value: any): void
Parameters
- value: any
Returns void
object Renderer
-
The object renderer used to render the objects.
Returns ObjectRenderer
oit Pass Count
-
get oitPassCount(): number
Defines the number of passes to use for Order Independent Transparency (default is 5).
Returns number
-
set oitPassCount(value: number): void
Parameters
- value: number
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[]
render Alpha Test Meshes
-
get renderAlphaTestMeshes(): boolean
Defines if alpha test meshes should be rendered (default is true). Always subject to the renderMeshes property, though.
Returns boolean
-
set renderAlphaTestMeshes(value: boolean): void
Parameters
- value: boolean
Returns void
render Depth Only Meshes
-
get renderDepthOnlyMeshes(): boolean
Defines if depth only meshes should be rendered (default is true). Always subject to the renderMeshes property, though.
Returns boolean
-
set renderDepthOnlyMeshes(value: boolean): void
Parameters
- value: boolean
Returns void
render Meshes
-
get renderMeshes(): boolean
Defines if meshes should be rendered (default is true).
Returns boolean
-
set renderMeshes(value: boolean): void
Parameters
- value: boolean
Returns void
render Opaque Meshes
-
get renderOpaqueMeshes(): boolean
Defines if opaque meshes should be rendered (default is true). Always subject to the renderMeshes property, though.
Returns boolean
-
set renderOpaqueMeshes(value: boolean): void
Parameters
- value: boolean
Returns void
render Particles
-
get renderParticles(): boolean
Defines if particles should be rendered (default is true).
Returns boolean
-
set renderParticles(value: boolean): void
Parameters
- value: boolean
Returns void
render Sprites
-
get renderSprites(): boolean
Defines if sprites should be rendered (default is true).
Returns boolean
-
set renderSprites(value: boolean): void
Parameters
- value: boolean
Returns void
render Transparent Meshes
-
get renderTransparentMeshes(): boolean
Defines if transparent meshes should be rendered (default is true). Always subject to the renderMeshes property, though.
Returns boolean
-
set renderTransparentMeshes(value: boolean): void
Parameters
- value: boolean
Returns void
reverse Culling
-
get reverseCulling(): boolean
Whether to reverse culling (default is false).
Returns boolean
-
set reverseCulling(value: boolean): void
Parameters
- value: boolean
Returns void
use OIT For Transparent Meshes
-
get useOITForTransparentMeshes(): boolean
Defines if Order Independent Transparency should be used for transparent meshes (default is false).
Returns boolean
-
set useOITForTransparentMeshes(value: boolean): void
Parameters
- value: boolean
Returns void
Methods
dispose
-
Disposes of the task.
Returns void
exclude Skinned Mesh From Velocity Texture
-
Excludes the given skinned mesh from computing bones velocities. Computing bones velocities can have a cost. The cost can be saved by calling this function and by passing the skinned mesh to ignore.
Parameters
- skinnedMesh: AbstractMesh
The mesh containing the skeleton to ignore when computing the velocity map.
Returns void
- skinnedMesh: AbstractMesh
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
-
record(
skipCreationOfDisabledPasses?: boolean,
additionalExecute?: (context: FrameGraphRenderContext) => void,
): FrameGraphRenderPassRecords the geometry renderer task into the frame graph.
Parameters
- skipCreationOfDisabledPasses: boolean = false
defines whether disabled passes should be skipped
OptionaladditionalExecute: (context: FrameGraphRenderContext) => voiddefines an optional callback executed by the pass
Returns FrameGraphRenderPass
the recorded render pass
- skipCreationOfDisabledPasses: boolean = false
remove Excluded Skinned Mesh From Velocity Texture
-
Removes the given skinned mesh from the excluded meshes to integrate bones velocities while rendering the velocity map.
Parameters
- skinnedMesh: AbstractMesh
The mesh containing the skeleton that has been ignored previously.
Returns void
- skinnedMesh: AbstractMesh
set Output Layer And Face Indices
-
Sets the output layer and face indices for multi-target rendering.
Parameters
- indices: LayerAndFaceIndex[]
The array of layer and face indices.
Returns void
- indices: LayerAndFaceIndex[]
Task used to render geometry to a set of textures.