API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfaceWgslContribution
What an UpdateModule contributes to the system's composite compute shader. `body` runs once per particle in the inner main function, with these locals in scope: - `idx: u32` - the particle slot index (already gated on `< sim.liveCount` and skip-on-dead via `timing[idx].y < 0.0`). - `dt: f32` - frame delta in seconds (mirrors `sim.dt`). - **Packed SoA bindings** (see body of doc) - channels are packed into `vec2<f32>`-typed storage buffers to fit within WebGPU's default 8-buffer limit. Access x/y components for the per-axis values: - `positions[idx].x` / `.y` (was posX/posY) - `velocities[idx].x` / `.y` (was velX/velY) - `scales[idx].x` / `.y` (was scaleX/scaleY) - `rotInfo[idx].x` / `.y` (rotation, rotationSpeed) - `timing[idx].x` / `.y` (elapsed, lifetime - y is set to -1 when expired) - `color[idx]` - packed RGBA u32, single channel (no .x/.y) - `sim: SimUniforms` - `{ dt: f32, liveCount: u32 }`. - `modules.u_${key}: ${Key}Uniforms` - your module's uniform struct (if declared). - `u_${key}_${textureName}` and `u_${key}_${textureName}_sampler` - texture bindings (if any). The body should not declare new functions or top-level statements; it runs inline in the main function. Use comments and parentheses generously - composition concatenates several module bodies and any syntax mistake surfaces only at pipeline-creation time.
import { WgslContribution } from '@codexo/exojs-particles'What an UpdateModule contributes to the system's composite compute shader. `body` runs once per particle in the inner main function, with these locals in scope:
- `idx: u32` - the particle slot index (already gated on `< sim.liveCount` and skip-on-dead via `timing[idx].y < 0.0`). - `dt: f32` - frame delta in seconds (mirrors `sim.dt`). - **Packed SoA bindings** (see body of doc) - channels are packed into `vec2<f32>`-typed storage buffers to fit within WebGPU's default 8-buffer limit. Access x/y components for the per-axis values: - `positions[idx].x` / `.y` (was posX/posY) - `velocities[idx].x` / `.y` (was velX/velY) - `scales[idx].x` / `.y` (was scaleX/scaleY) - `rotInfo[idx].x` / `.y` (rotation, rotationSpeed) - `timing[idx].x` / `.y` (elapsed, lifetime - y is set to -1 when expired) - `color[idx]` - packed RGBA u32, single channel (no .x/.y) - `sim: SimUniforms` - `{ dt: f32, liveCount: u32 }`. - `modules.u_${key}: ${Key}Uniforms` - your module's uniform struct (if declared). - `u_${key}_${textureName}` and `u_${key}_${textureName}_sampler` - texture bindings (if any).
The body should not declare new functions or top-level statements; it runs inline in the main function. Use comments and parentheses generously - composition concatenates several module bodies and any syntax mistake surfaces only at pipeline-creation time.
body: stringkey: stringprelude?: stringtextures?: readonly WgslTextureBindingA 1D texture binding (used by Curve / ColorGradient lookups).[]