CustomRenderPass class abstract Rendering

A user-supplied render pass inserted into the built-in pipeline at a named stage. Add one with Scene.addRenderPass.

A pass composes two engine-driven primitives on the RenderPassContext: RenderPassContext.drawObjects (render a filtered set of nodes flat into a mask texture) and RenderPassContext.applyShader (run a full-screen fragment shader that reads the current color and writes the next). The built-in selection outline is exactly a drawObjects mask composited by an applyShader outline shader, so anything it does, a custom pass can.

class TintPass extends CustomRenderPass {
  TintPass(this.shader);
  final gpu.Shader shader;
  @override
  String get name => 'tint';
  @override
  RenderStage get stage => RenderStage.afterToneMapping;
  @override
  void execute(RenderPassContext context) {
    context.applyShader(shader); // reads input_color, writes the chain
  }
}

Constructors

CustomRenderPass()

Properties

enabled bool
Whether this pass runs. A disabled pass is skipped entirely (it never consumes a buffer), so toggling it does not disturb the rest of the chain.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
inputs Set<RenderInput>
The engine geometry buffers this pass reads, beyond the always-available scene color. Declaring one makes the engine produce it this frame and exposes it on the RenderPassContext. Empty by default (color only).
no setter
name String
A short human-readable name, used for debugging.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stage RenderStage
Where in the pipeline this pass runs.
no setter

Methods

execute(RenderPassContext context) → void
Records this pass's work for one frame using context.
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