API

Interface GeometryRendererTaskConfig

Configuration for a geometry-renderer frame-graph task. Describes the meshes, camera, target size, geometry texture attachments, and optional real-color output target used by the MRT pass.

interface GeometryRendererTaskConfig {
    camera?: Camera | null;
    depthTexture?: RenderTarget | null;
    meshes?: readonly Mesh[];
    name?: string;
    reverseCulling?: boolean;
    samples?: 1 | 4;
    size?:
        | SurfaceContext
        | RenderTargetSurfaceSize
        | { height: number; width: number };
    targetTexture?: RenderTarget;
    targetTextureClearColor?: GPUColor;
    textureDescriptions: readonly GeometryRendererTextureDescription[];
}
Index
camera?: Camera | null

Per-pass camera override. Defaults to scene.camera.

depthTexture?: RenderTarget | null

Externally-owned depth attachment. When omitted, the task creates its own depth32float depth texture sized to match the color attachments.

meshes?: readonly Mesh[]

Caster meshes. When omitted, defaults to scene.meshes.

name?: string
reverseCulling?: boolean

Flip culling direction. Default false.

samples?: 1 | 4

MSAA sample count. Defaults to 1.

size?:
    | SurfaceContext
    | RenderTargetSurfaceSize
    | { height: number; width: number }

Render-target size. Defaults to the scene's surface; accepts live { surface, scale } dimensions as well as full surfaces and pixels.

targetTexture?: RenderTarget

Optional color render-target that receives the real (lit) material color, written as an additional color attachment alongside the geometry data attachments. Must have the same sampleCount and resolved pixel size as the geometry MRT (size: <surface> with samples matching). When omitted, no real-color attachment is added to the pass.

The target attachment uses loadOp: "load" (matches BJS), so the caller must initialize the target's contents (e.g. via a clear pass) before the geometry task runs — unless targetTextureClearColor is provided.

targetTextureClearColor?: GPUColor

When set together with targetTexture, the target attachment uses loadOp: "clear" with this color at the start of the geometry pass. Convenient for demo / standalone use where no prior task has initialized the target's contents.

textureDescriptions: readonly GeometryRendererTextureDescription[]

Ordered list of MRT attachments (1..8). The array index becomes the fragment shader's @location(i) and the render-pass color attachment slot.