API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classMultiRenderTarget
An off-screen render target with several colour attachments, written in one pass. One draw can produce more than one image: a colour pass that also writes a selection id, a normal buffer, a velocity buffer. Without it the same information costs one full pass per output, re-transforming and re-rasterizing the same geometry each time. Each attachment is an ordinary RenderTexture and is sampled like any other texture once the pass has run. They are OWNED by this target - created, resized and destroyed with it - because a mismatched attachment size is a framebuffer-completeness error on WebGL2 and a validation error on WebGPU, and that is not a failure worth handing to callers to avoid. # What can draw into one A Mesh or a Sprite carrying a material whose fragment shader declares one output per attachment - a `MeshMaterial` or a `SpriteMaterial` respectively. Both renderers build their pipeline from the attachment formats of the pass they run in, so a material that declares the outputs is drawn; one that declares fewer is refused with a `RenderError` rather than writing attachment 0 on WebGL2 and failing pipeline creation on WebGPU. Every other renderer - text, nine-slice, repeating sprites, video - and both default materials declare a single output, so drawing one into this target throws a `RenderError` naming the reason rather than minting pipeline variants nothing writes to. Mask and backdrop-blend compositing stay single-target for the same reason. A single-attachment target is still just a RenderTexture - reach for this only when one pass genuinely has to produce two images.
import { MultiRenderTarget } from '@codexo/exojs'An off-screen render target with several colour attachments, written in one pass.
One draw can produce more than one image: a colour pass that also writes a selection id, a normal buffer, a velocity buffer. Without it the same information costs one full pass per output, re-transforming and re-rasterizing the same geometry each time.
Each attachment is an ordinary RenderTexture and is sampled like any other texture once the pass has run. They are OWNED by this target - created, resized and destroyed with it - because a mismatched attachment size is a framebuffer-completeness error on WebGL2 and a validation error on WebGPU, and that is not a failure worth handing to callers to avoid.
# What can draw into one
A Mesh or a Sprite carrying a material whose fragment shader declares one output per attachment - a `MeshMaterial` or a `SpriteMaterial` respectively. Both renderers build their pipeline from the attachment formats of the pass they run in, so a material that declares the outputs is drawn; one that declares fewer is refused with a `RenderError` rather than writing attachment 0 on WebGL2 and failing pipeline creation on WebGPU.
Every other renderer - text, nine-slice, repeating sprites, video - and both default materials declare a single output, so drawing one into this target throws a `RenderError` naming the reason rather than minting pipeline variants nothing writes to. Mask and backdrop-blend compositing stay single-target for the same reason.
A single-attachment target is still just a RenderTexture - reach for this only when one pass genuinely has to produce two images.
new(width: number, height: number, options: MultiRenderTargetOptionsConstruction options for MultiRenderTarget.): MultiRenderTarget_enableDepthTexture(): void_syncDepthSize(): void_touch(): voidaddDestroyListener(listener: () => void): thisdestroy(): voidgetViewport(view: View2D camera that defines what region of the world is visible on screen. Maintains a center position, a visible area size, a rotation, and an optional zoom level.…): RectangleMutable axis-aligned rectangle defined by a top-left origin `(x, y)` and dimensions `(width, height)`. Implements Collidable with full SAT collision response f…mapCoordsToPixel(point: VectorConcrete mutable 2D vector with full AbstractVector arithmetic and Collidable collision support (treated as a point collider). `Vector.temp` provides a shared…, view: View2D camera that defines what region of the world is visible on screen. Maintains a center position, a visible area size, a rotation, and an optional zoom level.…): VectorConcrete mutable 2D vector with full AbstractVector arithmetic and Collidable collision support (treated as a point collider). `Vector.temp` provides a shared…mapPixelToCoords(point: VectorConcrete mutable 2D vector with full AbstractVector arithmetic and Collidable collision support (treated as a point collider). `Vector.temp` provides a shared…, view: View2D camera that defines what region of the world is visible on screen. Maintains a center position, a visible area size, a rotation, and an optional zoom level.…): VectorConcrete mutable 2D vector with full AbstractVector arithmetic and Collidable collision support (treated as a point collider). `Vector.temp` provides a shared…removeDestroyListener(listener: () => void): thisresize(width: number, height: number): thisupdateViewport(): thisneedsStencil: booleandestroyed: booleanheight: numberroot: booleanversion: numberwidth: number