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 PostCameraInfo std140 uniform block for reconstructing world positions from sceneDepthLinear. Layout: a vec4 (tan(fovX/2), tan(fovY/2), near, far), then the camera basis as three vec4s (right, up, forward, matching the depth prepass's view space: the eye at the origin looking down +forward), then a vec4 camera world position. Reconstruct with viewZ = depth; viewXY = (2*uv - 1 flipped) * viewZ * tangents; world = position + right*viewX + up*viewY + forward*viewZ. Bind it under a PostCameraInfo block via applyShader's uniforms. The projection terms are zero for a non-perspective camera (where depth is unavailable).
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_color automatically; 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) and the camera is perspective; also present when ambient occlusion or reflections ran.
no setter
shadowInfo ByteData?
The packed PostShadowInfo std140 uniform block matching shadowMap: four mat4 world->cascade-clip matrices, a vec4 of the cascades' view-space split distances, a vec4 light direction (xyz world travel direction, w = cascade count), and a vec4 light color (rgb, premultiplied by intensity). Bind it under a PostShadowInfo block via applyShader's uniforms. Null when shadowMap is null.
no setter
shadowMap Texture?
The directional light's cascaded shadow map atlas (a horizontal strip of shadowInfo cascade tiles, window-space depth in the red channel). Non-null when the pass declared RenderInput.shadowMap and the scene has a shadow-casting directional light. Pair with shadowInfo.
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 fragmentShader as a full-screen pass that advances this stage's color chain: the engine binds the current color as sampler2D input_color (sampled at the v_uv varying), renders into the next buffer, and makes it the current color for downstream passes.
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