Advanced
A Pixi-flavored Color Attachment that mirrors the WebGPU spec but replaces low-level JIT requirements with high-level Pixi objects (like texture).
texture
import { RenderTarget, TextureSource } from 'pixi.js';const renderTarget = new RenderTarget({ colorAttachments: [{ texture: new TextureSource({ width: 100, height: 100 }), loadOp: 'clear', // Clears the texture before rendering clearValue: [1, 0, 0, 1], // Clears to red }]}); Copy
import { RenderTarget, TextureSource } from 'pixi.js';const renderTarget = new RenderTarget({ colorAttachments: [{ texture: new TextureSource({ width: 100, height: 100 }), loadOp: 'clear', // Clears the texture before rendering clearValue: [1, 0, 0, 1], // Clears to red }]});
The Pixi texture to render to.
Optional
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.
A Pixi-flavored Color Attachment that mirrors the WebGPU spec but replaces low-level JIT requirements with high-level Pixi objects (like
texture).Example