Skip to content

Documentation / scene / PostEffectSetupContext

Interface: PostEffectSetupContext ​

Defined in: libs/scene/src/posteffect/posteffect.ts:62

Build-time context handed to AbstractPostEffect.setup.

The context carries everything an effect needs to declare its passes on the render graph. Where the effect output physically lands (intermediate texture, backbuffer or screen) is decided by PostEffectSetupContext.createOutput; effect implementations never deal with final-target selection themselves.

Properties ​

graph ​

readonly graph: RenderGraph

Defined in: libs/scene/src/posteffect/posteffect.ts:64

The render graph being built for this frame.


ctx ​

readonly ctx: DrawContext

Defined in: libs/scene/src/posteffect/posteffect.ts:66

Frame draw context. Read configuration from it, never textures.


blackboard ​

readonly blackboard: RGBlackboard

Defined in: libs/scene/src/posteffect/posteffect.ts:68

Named frame resources (linear depth, motion vectors, GBuffer, ...).


input ​

readonly input: RGHandle

Defined in: libs/scene/src/posteffect/posteffect.ts:70

Chain input: color output of the previous effect (or the scene color).


colorFormat ​

readonly colorFormat: TextureFormat

Defined in: libs/scene/src/posteffect/posteffect.ts:72

Intermediate color format of the post effect chain.


width ​

readonly width: number

Defined in: libs/scene/src/posteffect/posteffect.ts:74

Render width in pixels.


height ​

readonly height: number

Defined in: libs/scene/src/posteffect/posteffect.ts:76

Render height in pixels.


history ​

readonly history: HistoryResourceManager<Texture2D<unknown>>

Defined in: libs/scene/src/posteffect/posteffect.ts:78

Cross-frame history resources, or null when unavailable.


sceneDepthAttachment ​

readonly sceneDepthAttachment: RGTextureAttachment

Defined in: libs/scene/src/posteffect/posteffect.ts:85

Scene depth attachment for intermediate passes that depth-test against scene depth: either a graph texture handle or a backend depth texture. Pass it as the depthAttachment of intermediate framebuffers; the final pass gets it through createOutput({needDepthAttachment: true}).

Methods ​

createOutput() ​

createOutput(builder, opts?): PostEffectOutput

Defined in: libs/scene/src/posteffect/posteffect.ts:109

Create the output target for the effect's final pass.

Must be called exactly once, inside the setup callback of the pass that produces the effect's final color. The compositor decides whether this resolves to an intermediate texture or a direct write to the final target.

Parameters ​

builder ​

RGPassBuilder

The pass builder of the effect's final pass.

opts? ​

Set needDepthAttachment when the pass depth-tests against scene depth.

needDepthAttachment? ​

boolean

Returns ​

PostEffectOutput

The resolved output target.

Released under the MIT License.