pixi.js
    Preparing search index...

    Interface PixiColorAttachmentAdvanced

    A Pixi-flavored Color Attachment that mirrors the WebGPU spec but replaces low-level JIT requirements with high-level Pixi objects (like texture).

    import { RenderTarget, TextureSource } from 'pixi.js';

    const renderTarget = new RenderTarget({
    colorAttachments: [
    // follows the bind: cleared when the bind clears, to red rather than the bind's clear colour
    { texture: new TextureSource({ width: 100, height: 100 }), clearValue: [1, 0, 0, 1] },
    // keeps what an earlier pass drew, even when the bind clears
    { texture: new TextureSource({ width: 100, height: 100 }), loadOp: 'load' },
    ],
    });
    interface PixiColorAttachment {
        clearValue?: RgbaArray;
        loadOp?: GPULoadOp;
        storeOp?: GPUStoreOp;
        texture: TextureSource;
        viewDescriptor?: GPUTextureViewDescriptor;
    }

    Hierarchy

    • Omit<
          GPURenderPassColorAttachment,
          "view"
          | "resolveTarget"
          | "loadOp"
          | "storeOp"
          | "clearValue",
      >
      • PixiColorAttachment
    Index
    clearValue?: RgbaArray

    What this attachment is cleared to when a pass clears it. Left out, the attachment takes the clear colour given with the bind, and the renderer's default colour when there is none. An integer-format attachment takes the numbers as integers.

    loadOp?: GPULoadOp

    Set to 'load' to keep this attachment's contents when a pass opens on the target, even when the bind clears, or on renderer.clear(); set it back to clear the attachment again. Anything else follows the bind's clear, and a bind with clear: false never clears an attachment, so restoring a target (pop(), a filter handing back) can't wipe it. WebGL1 clears all attachments or none.

    storeOp?: GPUStoreOp

    Whether the pass keeps what it drew into this attachment ('store', the default) or drops it ('discard').

    texture: TextureSource

    The Pixi texture to render to.

    viewDescriptor?: GPUTextureViewDescriptor

    Optional overrides for how the GPU views the texture (e.g., viewing a specific aspect or dimension). Rarely needed for 2D, but incredibly powerful for 3D and advanced compute pipelines.