@pixi/3d
    Preparing search index...

    Class PassBuilderAdvanced

    Declares what a pass reads and writes; GraphRenderPass#setup receives one

    Each declaration returns its handle, so const color = b.writeColor(b.targetColor) captures it inline.

    Index
    • Declares a read the graph doesn't bind, for a copy or a pass that builds its own bindings

      It keeps the earlier passes that write the texture running; get the texture in render with RenderGraph#getTexture.

      Type Parameters

      Parameters

      • handle: H

        The resource this pass reads.

      Returns H

      The same handle, for inline capture.

    • Declares a read-only depth attachment: the pass depth-tests against handle without writing it

      Parameters

      • handle: DepthHandle

        The depth resource attached read-only.

      Returns DepthHandle

      The same handle, for inline capture.

    • Declares that this pass samples handle through binding

      The graph puts the frame's texture in the binding before the pass renders. A texture the graph allocated that another pass attaches as a render target needs a bind group this pass owns; RenderGraph#compile throws for a global binding.

      Type Parameters

      Parameters

      • handle: H

        The resource this pass samples.

      • binding: TextureBinding

        Where the texture goes.

      Returns H

      The same handle, for inline capture.

    • Keeps this pass running when no other pass reads what it writes, for work that leaves the graph, such as a readback to the CPU

      The graph runs a pass only when a later pass uses what it writes, or when it writes the screen, an imported texture or a camera's target. A pass that calls this in setup runs too, and so do the passes it reads from.

      It doesn't override the pass's condition: on a frame the condition skips this pass, any pass that only feeds it is skipped too. The scene still writes every scene output a pass requires, every frame.

      Returns void

      graph.addPass({
      name: 'pickReadback',
      bit: RenderPassBit.NONE,
      setup: (b) => {
      b.read(objectIds);
      b.sideEffect();
      },
      render: (session) => readPixelUnderPointer(graph.getTexture(objectIds, session)),
      });
    • Declares that this pass draws into handle as a render target

      The first pass each frame to write a texture the graph allocated clears it, unless that pass writes it with PassBuilder#produce instead; a texture you import with RenderGraph#importColor keeps its content. Later writers draw over earlier ones, and a pass that writes several colours attaches them in the order it declares them.

      A pass's target is exactly the attachments it declares, so to draw into this pass's target, declare both writeColor(b.targetColor) and writeDepth(b.targetDepth). Declared alone, the colour gets a target of its own: over the screen that isn't pixi's target, and inside a 2D filter it loses the view's place on the filter's texture.

      Parameters

      • handle: ColorHandle

        The colour resource this pass writes as an attachment.

      Returns ColorHandle

      The same handle, for inline capture.