RenderPassContext class Rendering
The frame context handed to CustomRenderPass.execute.
A friendlier facade over the internal render graph. It exposes the standard pipeline buffers as read-only gpu.Texture handles, an object-filtered draw (drawObjects), and a full-screen shader step (applyShader) that advances this stage's color chain. The engine owns all GPU orchestration; a pass never creates command buffers or pipelines itself. It is created by the engine; do not construct one.
Properties
- camera → Camera
-
The camera the current view is rendered with.
final
- cameraInfo → ByteData
-
A packed
PostCameraInfostd140 uniform block for reconstructing world positions from sceneDepthLinear, for any camera projection. Layout:no setter - currentColor → Texture
-
The current color for this stage's chain (HDR at the HDR stages, the
display image at the display stages). applyShader binds this as
input_colorautomatically; this getter is for sampling it explicitly.no setter - dimensions → Size
-
The render-target size in physical pixels.
final
- displayColor → Texture
-
The current display-referred image (after tone mapping). Throws if read
at the RenderStage.afterScene / RenderStage.beforeToneMapping
stages (it does not exist yet); use sceneColorHdr there.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sceneColorHdr → Texture
-
The linear HDR scene color. Available at every stage (at the
display-referred stages it is the pre-tone-mapped color), so a custom
pass can reach back to the HDR image.
no setter
- sceneDepthLinear → Texture?
-
The linear (view-space) depth buffer: planar view-space depth (world
units) in the red channel, with the octahedral-packed view-space normal in
green/blue when RenderInput.normals was requested. Non-null when the pass
declared RenderInput.depth (or RenderInput.normals); also present when
ambient occlusion or reflections ran.
no setter
- shadowInfo → ByteData?
-
The packed
PostShadowInfostd140 uniform block matching shadowMap: fourmat4world->cascade-clip matrices, avec4of the cascades' view-space split distances, avec4light direction (xyz world travel direction, w = cascade count), and avec4light color (rgb, premultiplied by intensity). Bind it under aPostShadowInfoblock via applyShader'suniforms. Null when shadowMap is null.no setter - shadowMap → Texture?
-
The shared shadow atlas (a horizontal strip of tiles, window-space depth
in the red channel): the directional cascades first, then one tile per
casting spot (see spotShadows). Non-null when the pass declared
RenderInput.shadowMap and a light cast this frame. Pair with
shadowInfo for the cascades.
no setter
- spotShadows → SpotShadowInfo?
-
The spot shadows' place in shadowMap (their matrices and tiles), or
null when no spot cast this frame. Spot tiles share the atlas with the
directional cascades, so a pass that samples spot shadows declares
RenderInput.shadowMap and reads the atlas from shadowMap.
no setter
- stage → RenderStage
-
The stage this pass was registered for.
final
Methods
-
applyShader(
Shader fragmentShader, {Map< String, Texture> textures = const {}, Map<String, SamplerOptions> samplers = const {}, Map<String, ByteData> uniforms = const {}, bool frameInfo = false}) → void -
Runs
fragmentShaderas a full-screen pass that advances this stage's color chain: the engine binds the current color assampler2D input_color(sampled at thev_uvvarying), renders into the next buffer, and makes it the current color for downstream passes. -
debugBlackboardTexture(
String key) → Texture? -
A raw pipeline texture by blackboard
key(ssao_texture,bloom_texture,selection_mask, ...), for debug visualization overlays. Null when the frame did not produce it, or unless the host opted into render-graph debugging (Scene.debugAllowRenderGraphCapture); the named getters above remain the supported surface for real effects. -
drawObjects(
{NodeFilter filter = const NodeFilter.all(), Vector4? color, Vector4 colorOf(Object node)?, Vector4? clearColor}) → Texture - Draws a filtered set of the scene's geometry flat into a returned mask texture, each object filled with a color (coverage in alpha), with its own cleared depth so the objects self-occlude but are not occluded by the rest of the scene (an x-ray silhouette). The building block for masks, outlines, and highlights; sample the result in applyShader.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited