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. Layout: avec4(tan(fovX/2), tan(fovY/2), near, far), then the camera basis as threevec4s (right, up, forward, matching the depth prepass's view space: the eye at the origin looking down +forward), then avec4camera world position. Reconstruct withviewZ = depth; viewXY = (2*uv - 1 flipped) * viewZ * tangents; world = position + right*viewX + up*viewY + forward*viewZ. Bind it under aPostCameraInfoblock via applyShader'suniforms. 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_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) and the camera is
perspective; 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 directional light's cascaded shadow map atlas (a horizontal strip of
shadowInfocascade 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
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. -
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