Reference for post-processing, fragment-feedback, and compute APIs shared by Svelte/React/Vue adapters and core entrypoints.
Entrypoints
Shared render-pass options
ShaderPass, BlitPass, and CopyPass share these post-scene render-pass options:
ShaderPass
Programmable post-process pass.
Required shader contract:
Additional option:
Runtime update API:
BlitPass
Fullscreen texture sample pass with configurable filter ('linear' or 'nearest').
CopyPass
Attempts direct GPU texture copy (copyTextureToTexture) and falls back to blit if conditions are not met.
Direct-copy path requires all of:
clear === falsepreserve === true- source and output are different textures
- neither surface is
canvas - matching dimensions and format
ComputePass
GPU compute pass for single-dispatch workloads.
Compute passes are renderer-managed pre-scene workloads. The public extension point is the WGSL source plus dispatch strategy passed to ComputePass or PingPongComputePass.
Required shader contract:
All three elements are validated at construction time: the @compute annotation, @workgroup_size(...), and @builtin(global_invocation_id) parameter.
Options
Runtime update API
ComputeDispatchContext
PingPongComputePass
Iterative compute pass for multi-step GPU simulations.
Options
Runtime update API
Properties
PingPongShaderPass
Iterative fragment-feedback pass for fullscreen simulations that read the previous texture state and write the next one. The renderer executes it in the pre-scene phase, owns two A/B render textures, and exposes the latest output through the declared material texture target before the base scene renders.
Required shader contract:
The generated shader adds these previous-state bindings:
group(0) contains frame uniforms, user uniforms, and fragment-visible material textures except the target texture. The target is intentionally excluded while the feedback pass is writing, so read previous state only through motiongpuPrevious.
Options
Runtime update API
Properties
Texture coordinates
PingPongShaderPass uv is aligned with the feedback render texture so previous-state reads and current writes hit the same row across iterations. When the target is sampled later by a normal material using its public Y-up frag(uv) coordinates, the visible result lines up with the material shader.
Slot constraints
Compute and fragment-feedback passes do not participate in slot routing. They have no input, output, or needsSwap options, and they always execute before the base scene render. Render pass order is preserved only within the post-scene render-pass group.