Documentation / scene / PostEffectSetupContext
Interface: PostEffectSetupContext
Defined in: libs/scene/src/posteffect/posteffect.ts:61
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
readonlygraph:RenderGraph
Defined in: libs/scene/src/posteffect/posteffect.ts:63
The render graph being built for this frame.
ctx
readonlyctx:DrawContext
Defined in: libs/scene/src/posteffect/posteffect.ts:65
Frame draw context. Read configuration from it, never textures.
blackboard
readonlyblackboard:RGBlackboard
Defined in: libs/scene/src/posteffect/posteffect.ts:67
Named frame resources (linear depth, motion vectors, GBuffer, ...).
input
readonlyinput:RGHandle
Defined in: libs/scene/src/posteffect/posteffect.ts:69
Chain input: color output of the previous effect (or the scene color).
colorFormat
readonlycolorFormat:TextureFormat
Defined in: libs/scene/src/posteffect/posteffect.ts:71
Intermediate color format of the post effect chain.
width
readonlywidth:number
Defined in: libs/scene/src/posteffect/posteffect.ts:73
Render width in pixels.
height
readonlyheight:number
Defined in: libs/scene/src/posteffect/posteffect.ts:75
Render height in pixels.
history
readonlyhistory:HistoryResourceManager<Texture2D<unknown>>
Defined in: libs/scene/src/posteffect/posteffect.ts:77
Cross-frame history resources, or null when unavailable.
sceneDepthAttachment
readonlysceneDepthAttachment:unknown
Defined in: libs/scene/src/posteffect/posteffect.ts:84
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:108
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
The pass builder of the effect's final pass.
opts?
Set needDepthAttachment when the pass depth-tests against scene depth.
needDepthAttachment?
boolean
Returns
The resolved output target.