@pixi/3d
    Preparing search index...

    Interface ForwardRenderPassOptionsAdvanced

    Options for constructing a ForwardRenderPass

    interface ForwardRenderPassOptions {
        attachedOutputs?: readonly SceneOutput[];
        bit?: number;
        cache?: "auto" | "never";
        camera?: Camera3D;
        description?: string;
        descriptor?: PassDescriptorOptions;
        name: string;
        renderer:
            | WebGLRenderer<HTMLCanvasElement>
            | WebGPURenderer<HTMLCanvasElement>;
        sort: "key" | "distance";
    }

    Hierarchy (View Summary)

    Index
    attachedOutputs?: readonly SceneOutput[]

    The scene outputs this pass draws into after its colour, in order; see SceneOutput

    Output i is written by the shader's fragment output at location i + 1, and a draw leaves alone any output its shader doesn't write. This differs from Pass3D#requiredOutputs, which only makes the outputs exist this frame. The default graph gives its scene outputs to its depth clear, background, opaque, transmission and transparent passes; see DefaultGraph3DOptions#sceneOutputs.

    bit?: number

    Bit for this pass; leave it out on a custom pass that draws meshes, so its name gets one, and give RenderPassBit.NONE to one that draws none

    cache?: "auto" | "never"

    Whether the pass may reuse its draws across frames where nothing changed

    Defaults to 'auto' on a 'key' pass, where 'never' makes it rebuild its draws every frame, and to 'never' on a 'distance' pass. Leave it out there: 'auto' makes WebGPU draw a 'distance' pass in key order, not back to front.

    camera?: Camera3D

    Camera this pass draws from

    Omit it and the pass draws from the view's own camera onto the view. Give it a Camera3D in the same view and the pass culls and draws from that camera instead. Give the camera a renderTexture and the image lands in that texture, for a security feed, a mirror, a portal, or a minimap shown in a 2D sprite; add such a pass at the 'beforeOpaque' stage so the scene can sample the texture the same frame.

    A feed with glass needs its own copies and glass passes. From the Pass3D#build that adds the feed's draws, give this camera to a CopyDepthPass, a CopyOpaquePass, a TransmissionRenderPass and a BlendedRefractionPass, in that order after the feed's opaque draw. Allocate the copies' textures with RenderGraph#createColor and RenderGraph#createDepth; PassContext#opaqueColor and PassContext#opaqueDepth hold the view camera's.

    description?: string

    Human-readable explanation shown by tooling that inspects the render graph

    Shader, state and topology this pass uses for every mesh it draws

    Each field is optional, and a material's own entry for this pass name, in its passes option, wins over it; PassDescriptor lists the full order. Of the passes sharing a name, only the one with no camera, or the first when they all have one, may set this.

    On one of a material's main passes, such as 'opaque', a pass with a shader here must be the only pass with that name, or the others can throw on WebGL.

    name: string

    Stable string identifier for this pass, such as 'shadow' or 'outline'

    Materials name the pass by it in their passes option, so they never need its bit. Several passes in a view can share a name to draw the same meshes from different cameras, but only one of them may leave out camera.

    Renderer the pass draws with: the PassContext#renderer a Pass3D#build call receives

    sort: "key" | "distance"

    Draw order

    • 'key': stable batch and pipeline order, so the draw work can be cached between frames. Right for opaque surfaces.
    • 'distance': back to front by distance from the camera, re-sorted every frame. Right for alpha blending.