SceneEncoder class base

Records draw calls for one frame's color pass into a single gpu.RenderPass.

A render-graph pass (see ScenePass) creates a gpu.RenderPass, constructs an encoder against it, calls submit for every RenderItem the scene's spatial structure reports visible, then calls flush to sort and emit the deferred draws.

The encoder splits draws into two phases within the one render pass:

  1. Opaque, with depth writes enabled and color blending disabled, sorted by pipeline (to reduce state changes) and then front-to-back (so the depth test can reject occluded fragments early).
  2. Translucent, depth-sorted back to front from the camera, drawn with premultiplied source-over blending.

Applications typically do not construct SceneEncoder directly; custom Geometry or Material subclasses interact with it through their bind callbacks, which receive the gpu.RenderPass and gpu.HostBuffer directly.

Constructors

SceneEncoder(RenderPass renderPass, HostBuffer transientsBuffer, Camera _camera, Size dimensions, Lighting _lighting)
Creates an encoder that records into renderPass, allocating transient uniforms from transientsBuffer.

Properties

cullScratchAabb → Aabb3
Reusable AABB owned by this encoder so the per-item cull check can transform a local AABB into world space without allocating a new Aabb3 for every item, every frame.
final
frustum ↔ Frustum
View frustum derived from the camera's view-projection matrix at the start of this frame. Used by submit for per-item culling.
latefinal
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

flush() → void
Sorts and emits every deferred draw, then finishes recording.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
submit(RenderItem item) → void
Queues a draw call for item, unless it is hidden or frustum culled.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited