Class FrameGraphRenderContext
Hierarchy (View Summary)
- FrameGraphContext
- FrameGraphRenderContext
Index
Properties
Methods
Properties
enable Debug Markers
If true, debug markers will be enabled in the context.
Methods
apply Full Screen Effect
-
applyFullScreenEffect(
drawWrapper: DrawWrapper,
customBindings?: () => void,
stencilState?: any,
disableColorWrite?: boolean,
drawBackFace?: boolean,
depthTest?: boolean,
noViewport?: boolean,
alphaMode?: number,
): booleanApplies a full-screen effect to the current render target
Parameters
- drawWrapper: DrawWrapper
The draw wrapper containing the effect to apply
OptionalcustomBindings: () => voidThe custom bindings to use when applying the effect (optional)
OptionalstencilState: anyThe stencil state to use when applying the effect (optional)
OptionaldisableColorWrite: booleanIf true, color write will be disabled when applying the effect (optional)
OptionaldrawBackFace: booleanIf true, the fullscreen quad will be drawn as a back face (in CW - optional)
OptionaldepthTest: booleanIf true, depth testing will be enabled when applying the effect (default is false)
OptionalnoViewport: booleanIf true, the current viewport will be left unchanged (optional). If false or undefined, the viewport will be set to the full render target size.
- alphaMode: number = Constants.ALPHA_DISABLE
The alpha mode to use when applying the effect (default is ALPHA_DISABLE)
Returns boolean
True if the effect was applied, otherwise false (effect not ready)
- drawWrapper: DrawWrapper
bind Attachments
-
Binds the attachments to the current render target
Parameters
- attachments: number[]
The attachments to bind
Returns void
- attachments: number[]
bind Render Target
-
Binds a render target texture so that upcoming draw calls will render to it Note: it is a lazy operation, so the render target will only be bound when needed. This way, it is possible to call this method several times with different render targets without incurring the cost of binding if no draw calls are made
Parameters
OptionalrenderTarget: anyThe handle of the render target texture to bind (default: undefined, meaning "back buffer"). Pass an array for MRT rendering.
- applyImmediately: boolean = false
If true, the render target will be applied immediately (otherwise it will be applied at first use). Default is false (delayed application).
Returns void
bind Texture Handle
-
Binds a texture handle to a given effect (resolves the handle to a texture and binds it to the effect)
Parameters
- effect: Effect
The effect to bind the texture to
- name: string
The name of the texture in the effect
- handle: FrameGraphTextureHandle
The handle of the texture to bind
Returns void
- effect: Effect
clear
-
clear(
color: Nullable<IColor4Like>,
backBuffer: boolean,
depth: boolean,
stencil?: boolean,
stencilClearValue?: number,
): voidClears the current render buffer or the current render target (if any is set up)
Parameters
- color: Nullable<IColor4Like>
Defines the color to use
- backBuffer: boolean
Defines if the back buffer must be cleared
- depth: boolean
Defines if the depth buffer must be cleared
Optionalstencil: booleanDefines if the stencil buffer must be cleared
- stencilClearValue: number = 0
Defines the value to use to clear the stencil buffer (default is 0)
Returns void
- color: Nullable<IColor4Like>
clear Attachments
-
clearAttachments(
color: Nullable<IColor4Like>,
attachments: number[],
backBuffer: boolean,
depth: boolean,
stencil?: boolean,
stencilClearValue?: number,
): voidClears all attachments (color(s) + depth/stencil) of the current render target
Parameters
- color: Nullable<IColor4Like>
Defines the color to use
- attachments: number[]
The attachments to clear
- backBuffer: boolean
Defines if the back buffer must be cleared
- depth: boolean
Defines if the depth buffer must be cleared
Optionalstencil: booleanDefines if the stencil buffer must be cleared
- stencilClearValue: number = 0
Defines the value to use to clear the stencil buffer (default is 0)
Returns void
- color: Nullable<IColor4Like>
clear Color Attachments
-
Clears the color attachments of the current render target.
Float, signed-integer, and unsigned-integer attachments can be mixed in the same layout.
Parameters
- color: Nullable<IColor4Like>
Defines the color to use
- attachments: number[]
The attachments to clear
Returns void
- color: Nullable<IColor4Like>
copy Texture
-
copyTexture(
sourceTexture: FrameGraphTextureHandle,
forceCopyToBackbuffer?: boolean,
noViewport?: boolean,
lodLevel?: number,
): voidCopies a texture to the current render target
Parameters
- sourceTexture: FrameGraphTextureHandle
The source texture to copy from
- forceCopyToBackbuffer: boolean = false
If true, the copy will be done to the back buffer regardless of the current render target
OptionalnoViewport: booleanIf true, the current viewport will be left unchanged (optional). If false or undefined, the viewport will be set to the full render target size.
- lodLevel: number = 0
The LOD level to use when copying the texture (default: 0).
Returns void
- sourceTexture: FrameGraphTextureHandle
create Render Target
-
createRenderTarget(
name: string,
renderTargets?: any,
renderTargetDepth?: any,
depthReadOnly?: boolean,
stencilReadOnly?: boolean,
): FrameGraphRenderTargetCreates a (frame graph) render target wrapper Note that renderTargets or renderTargetDepth can be undefined, but not both at the same time!
Parameters
- name: string
Name of the render target wrapper
OptionalrenderTargets: anyRender target handles (textures) to use
OptionalrenderTargetDepth: anyRender target depth handle (texture) to use
OptionaldepthReadOnly: booleanIf true, the depth buffer will be read-only
OptionalstencilReadOnly: booleanIf true, the stencil buffer will be read-only
Returns FrameGraphRenderTarget
The created render target wrapper
- name: string
generate Mip Maps
-
Generates mipmaps for the current render target
Parameters
Optionalhandle: anyOptional handle of the texture to generate mipmaps for (if not provided, will generate mipmaps for all textures in the current render target)
Returns void
get Texture From Handle
-
Gets a texture from a handle. Note that if the texture is a history texture, the read texture for the current frame will be returned.
Parameters
- handle: FrameGraphTextureHandle
The handle of the texture
Returns Nullable<InternalTexture>
The texture or null if not found
- handle: FrameGraphTextureHandle
insert Debug Marker
-
Inserts a debug marker in the engine's debug stack.
Parameters
- text: string
The text of the debug marker
Returns void
- text: string
is Backbuffer
-
Checks whether a texture handle points to the backbuffer's color or depth texture
Parameters
- handle: FrameGraphTextureHandle
The handle to check
Returns boolean
True if the handle points to the backbuffer's color or depth texture, otherwise false
- handle: FrameGraphTextureHandle
is Backbuffer Color
-
Checks whether a texture handle points to the backbuffer's color texture
Parameters
- handle: FrameGraphTextureHandle
The handle to check
Returns boolean
True if the handle points to the backbuffer's color texture, otherwise false
- handle: FrameGraphTextureHandle
is Backbuffer Depth Stencil
-
Checks whether a texture handle points to the backbuffer's depth texture
Parameters
- handle: FrameGraphTextureHandle
The handle to check
Returns boolean
True if the handle points to the backbuffer's depth texture, otherwise false
- handle: FrameGraphTextureHandle
pop Debug Group
-
Pops a debug group from the engine's debug stack.
Returns void
push Debug Group
-
Pushes a debug group to the engine's debug stack.
Parameters
- name: string
The name of the debug group
Returns void
- name: string
render
-
render(
object: any,
viewportWidth?: number,
viewportHeight?: number,
restoreDefaultFramebuffer?: boolean,
): voidRenders a RenderTargetTexture or a layer
Parameters
- object: any
The RenderTargetTexture/Layer to render
OptionalviewportWidth: numberThe width of the viewport (optional for Layer, but mandatory for ObjectRenderer)
OptionalviewportHeight: numberThe height of the viewport (optional for Layer, but mandatory for ObjectRenderer)
- restoreDefaultFramebuffer: boolean = false
If true, the default framebuffer will be restored after rendering (default: false)
Returns void
- object: any
render Unmanaged
-
Renders a component without managing the render target. Use this method when you have a component that handles its own rendering logic which is not fully integrated into the frame graph system.
Parameters
- component: { render: () => void }
The component to render.
- intermediateRendering: boolean = true
If true, the scene's intermediate rendering flag will be set to true during the render call (default: true)
Returns void
- component: { render: () => void }
restore Default Framebuffer
-
Restores the default framebuffer (back buffer) as the current render target
Returns void
restore Depth States
-
Restores the depth states saved by saveDepthStates
Returns void
save Depth States
-
Saves the current depth states (depth testing and depth writing)
Returns void
set Depth States
-
Sets the depth states for the current render target
Parameters
- depthTest: boolean
If true, depth testing is enabled
- depthWrite: boolean
If true, depth writing is enabled
Returns void
- depthTest: boolean
set Texture Sampling Mode
-
Sets the texture sampling mode for a given texture handle
Parameters
- handle: FrameGraphTextureHandle
Handle of the texture to set the sampling mode for
- samplingMode: number
Sampling mode to set
Returns void
- handle: FrameGraphTextureHandle
set Viewport
-
Sets the current viewport
Parameters
- viewport: IViewportLike
defines the viewport element to be used
OptionalrequiredWidth: numberdefines the width required for rendering. If not provided, the width of the render texture is used.
OptionalrequiredHeight: numberdefines the height required for rendering. If not provided the height of the render texture is used.
Returns void
- viewport: IViewportLike
Frame graph context used render passes.