API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

C

classCallbackRenderPass

@codexo/exojs / rendering / stable

Runs a user callback as one pass. The callback receives a PassContext scoped to the active target: `pass.render(node)`, `pass.clear(color)`, `pass.drawGeometry(...)`, `pass.renderTo(...)`, and `pass.backend` for raw draws. Set `options.target` to redirect the callback's output into an off-screen RenderTexture (immediate-mode "scene" → texture); inside that redirect every `pass.*` verb operates on the texture. To run a low-level BackendRenderPass inside a pipeline, bridge it here: `new CallbackRenderPass((pass) => pass.backend.execute(myBackendPass))`. `view`/`target`/`clear` are fixed at construction; the off-screen redirect is built once and reused every frame (no per-frame allocation). `execute` is not re-entrant - a callback must not re-run the same pass instance; the reentrancy guard keeps the redirect's active context from being clobbered. If your callback closes over owned GPU resources, subclass RenderPass instead so you can override `destroy()`.

2
props
3
methods
0
events
Import
import { CallbackRenderPass } from '@codexo/exojs'

Runs a user callback as one pass. The callback receives a PassContext scoped to the active target: `pass.render(node)`, `pass.clear(color)`, `pass.drawGeometry(...)`, `pass.renderTo(...)`, and `pass.backend` for raw draws. Set `options.target` to redirect the callback's output into an off-screen RenderTexture (immediate-mode "scene" → texture); inside that redirect every `pass.*` verb operates on the texture.

To run a low-level BackendRenderPass inside a pipeline, bridge it here: `new CallbackRenderPass((pass) => pass.backend.execute(myBackendPass))`.

`view`/`target`/`clear` are fixed at construction; the off-screen redirect is built once and reused every frame (no per-frame allocation). `execute` is not re-entrant - a callback must not re-run the same pass instance; the reentrancy guard keeps the redirect's active context from being clobbered. If your callback closes over owned GPU resources, subclass RenderPass instead so you can override `destroy()`.

Constructors1
Methods3
destroy(): void
Release resources this pass allocated internally. No-op by default; idempotent. Never frees injected scene nodes or caller-provided RenderTextures - those are owned by the caller / scene.
Run this pass against context. The active render target is the canvas unless a parent redirected it. Called directly, this runs **regardless of enabled** - enabled is evaluated by the containing RenderPipeline, not self-checked here. Subclasses must not begin execute with if (!this.enabled).
resize(_width: number, _height: number): void
React to a surface / target size change. No-op by default; size-dependent passes (effects with scratch targets) override. Called by RenderPipeline.resize, which the caller wires to app.onResize.
Properties2
enabled: boolean
When false, the containing RenderPipeline skips this pass during execute. Default true. Evaluated by the parent - a direct execute call runs the pass regardless.
label: string
Debug label (inspector / logging). Defaults to the constructor name. Display only - not an identity.
Source