AdvancedOptions for creating a render target, or a WebGPU-flavored descriptor.
An array of attachments that define exactly how the GPU should render to the color textures. This includes the texture itself, as well as load/store operations and clear values.
OptionaldepthAn attachment that defines exactly how the GPU should render to the depth/stencil texture. Includes the texture, load/store operations, and depth/stencil specific clear values.
Optional AdvancedflipOpt-in toggle that inverts this target's Y orientation, resolved at bind time.
Defaults to undefined/false — a no-op, so rendering is exactly what it has always been
(texture targets flip so they sample upright in the 2D pipeline; the screen does not). Set true
to invert that automatic orientation — e.g. to store a capture in screen orientation for 3D, where
geometry UVs expect the un-flipped result.
When true, the projection Y-flip and the winding/cull inversion flip together, so a front-facing
triangle stays front-facing — back-face culling of content rendered into the target stays correct.
Optionallabela label for debugging — shows up on the render pass in GPU debuggers (WebGPU)
Readonlyuidunique id for this render target
StaticdefaultThe default options for a render target
An array of textures that can be written to by the GPU - mostly this has one texture in Pixi, but you could
write to multiple if required! (eg deferred lighting).
This is a backwards-compatible getter that extracts the textures from colorAttachments.
Whether this target provides a depth buffer — requested via options or implied by its attachment's format.
The texture the depth and stencil buffers write to. On an antialiased target shaders can't read it as a normal depth texture, see RenderTargetOptions.depthStencilTexture.
The texture that drives size, resolution, and resize events.
For standard targets this is colorAttachments[0].texture;
for depth-only targets it is depthStencilAttachment.texture.
Whether this target provides a stencil buffer — requested via options or implied by its attachment's format.
A class that describes what the renderers are rendering to. This can be as simple as a Texture, or as complex as a multi-texture, multi-sampled render target. Support for stencil and depth buffers is also included.
If you need something more complex than a Texture to render to, you should use this class. Under the hood, all textures you render to have a RenderTarget created on their behalf.
A render target can have several color attachments, each with its own format (for example
rgba16floatcolor,rg16floatvelocity andr32uintids). A draw writes only the attachments its fragment shader has an output for and leaves the rest alone, so a 2D sprite drawn into such a target changes attachment 0 only. Every attachment a draw writes blends with the draw's blend mode, except integer formats, which never blend, and a blended draw needs avec4output for each attachment it writes, as the blend reads its alpha. A clear sets each attachment to its ownclearValue, or to the clear color given with the bind where it has none; integer attachments take the numbers as integers, so a normal clear color (0 to 1) clears them to 0 or 1. The bind'scleardecides whether anything clears; an attachment withloadOp: 'load'keeps its contents even when the bind clears. An antialiased target can't have an integer attachment.Several render targets can be built over the same textures, for example one that writes a depth texture and one that only tests against it. They draw into the same pixels: an antialiased texture's samples are kept with the texture, not with a target. They are made when the texture is first drawn into and go with its GPU texture, when it is destroyed, unloaded or resized; destroying a target frees only what the target owns, not the samples of textures passed to it. Targets that share a depth/stencil texture must all be antialiased, or none of them. On WebGPU a canvas can have only one render target. Building a second reconfigures its context, and destroying one unconfigures it.