@pixi/3d
    Preparing search index...

    Class RenderPass<P>Advanced

    Base class for all render passes in the pipeline

    Each view runs its passes in order through its RenderGraph. A pass goes through these steps:

    • setup(builder) runs once, when the pass is added to the graph, and declares what the pass reads and writes.
    • condition(session), if the pass has one, can skip the pass for a frame.
    • prepare(session) runs before any render target is bound.
    • render(session) runs once the graph has bound the pass's target. A pass that declares only produce, sample or read accesses gets no target bound and does its own GPU work.

    P is the pipe type. Leave it as View3DPipe to run on both backends.

    Type Parameters

    • P extends View3DPipe = View3DPipe

    Hierarchy (View Summary)

    Index
    attachedOutputs: readonly SceneOutput[]

    The scene outputs attached after the target colour; see RenderPassOptions#attachedOutputs

    bit: number = 0

    Bit for this pass: the built-in one it was given, or the one its name was assigned

    camera: Camera3D | null

    Camera this pass draws from, or null to draw from the view's own camera

    See RenderPassOptions#camera. While render runs, the GPU viewport is the camera's rect.

    description?: string

    Human-readable explanation of what this pass contributes to the frame

    descriptor?: PassDescriptor

    Shader, state and topology this pass uses for every mesh, from RenderPassOptions#descriptor

    materialBits: readonly ShaderBit[]

    Shader bits a material adds when it draws in this pass, so it writes the attached outputs

    Each attached output's bits entry for this pass's name, in order. A material with a template of its own ignores them.

    name: string

    The pass's name; see RenderPassOptions#name

    outputLocations: readonly string[]

    The output each fragment location of a material shader in this pass writes: color, then each attached output

    pipe: P

    The view pipe of the renderer this pass was built for

    • Optional per-frame check; returning false skips the pass, prepare and render included

      The graph asks it before any pass draws, once the scene's transforms and the view's camera are up to date for the frame. Without one, the pass runs every frame.

      Parameters

      Returns boolean

      Whether the pass should run this frame

    • Releases the GPU resources this pass owns alone

      The graph calls it when the graph is destroyed. Override it to free the shaders, bind groups or render targets your pass created, leaving alone anything it only borrowed.

      Returns void

    • Runs before any pass draws or any render target is bound, once every pass's camera is current

      Override it to upload GPU buffers early. The default does nothing.

      Parameters

      Returns void

    • Draws this pass's contribution to the frame, once the graph has bound its target

      The default does nothing.

      Parameters

      Returns void

    • Declares what resources this pass reads, writes, and samples

      The graph calls it once, when the pass is added. The graph only runs a pass whose output the frame needs, so a pass that keeps this default, which declares nothing, never runs.

      Parameters

      • _builder: PassBuilder

        The builder recording this pass's resource accesses

      Returns void