Taos API Reference
    Preparing search index...

    Class ParticlePass

    GPU particle system pass (render-graph version).

    Compute (spawn -> update -> compact -> indirect-write) followed by an indirect billboard draw, either alpha-blended into the HDR target (forward mode) or additive into the GBuffer (deferred mode), driven by config.renderer.

    Hierarchy (View Summary)

    • Pass<ParticleDeps, ParticleOutputs>
      • ParticlePass
    Index

    Properties

    name: "ParticlePass" = 'ParticlePass'

    Human-readable identifier used in graph node labels and error messages.

    Accessors

    Methods

    • Sets the world-space center + radius of a sphere_collision modifier marked dynamic, so the collider can move at runtime (e.g. track a physics body). Radius 0 disables it. Takes effect on the next ParticlePass.update. No-op for graphs without a dynamic sphere collider (the uniform is ignored).

      Parameters

      • x: number
      • y: number
      • z: number
      • radius: number

      Returns void

    • Parameters

      • position: { x: number; y: number; z: number }
      • color: [number, number, number, number]
      • count: number

      Returns void

    • Create a ParticlePass for config.

      Parameters

      • ctx: RenderContext
      • config: ParticleGraphConfig
      • options: ParticlePassOptions = {}

        Construction-time options for ParticlePass.create.

        • OptionalparentSplit?: {
              split: SplitNode;
              queueBuffer: GPUBuffer;
              counterBuffer: GPUBuffer;
              capacity: number;
          }

          Set by the parent pass when this instance is a sub-emitter (split) child. Internal.

        • OptionalforwardPass?: ForwardPass

          Required when the config's renderer.type === 'mesh' and renderer.renderTarget === 'hdr'. The particle pass borrows this ForwardPass's lighting+IBL bind group layout for its instanced-PBR pipeline and its bind group at draw time, so all forward-lit content shares the same light/IBL state. The host must call forwardPass.updateLights(...) before ParticlePass.addToGraph.

        • OptionalheightmapRes?: number

          Side length in cells of the block_collision heightmap storage buffer. Default 128 (matches the historical hard-coded layout). Lower values trade resolution for cheaper CPU bakes; the shader uses the same uniform for sample-position math so this is safe to vary per pass. Ignored when the particle graph has no block_collision modifier.

      Returns ParticlePass

    • Writes only the heightmap uniform (origin xz / extent / resolution), leaving the data buffer untouched. For callers that bake the heights on GPU and only need to tell the collision shader where the heightmap is positioned in world space.

      Parameters

      Returns void

    • Updates the SDF's world transform (and uniform scale). The shader pulls world particle positions back into the SDF's local frame via transform's inverse before sampling, so this lets the host move/rotate/uniformly-scale the SDF without re-baking. No-op when the pass has no SDF bound.

      transform is a world matrix; the inverse is computed here and uploaded. scale (default 1) multiplies the sampled distance back into world units — pass the same uniform scale you used to build transform.

      Parameters

      Returns void

    • Insert the pass into graph for one frame. Implementations call graph.addPass(name, type, b => { ... }) exactly once and use the supplied PassBuilder to declare reads, writes, transient resources, and the execute callback.

      Parameters

      • graph: RenderGraph

        Graph being built this frame.

      • deps: ParticleDeps

        Pass-specific dependency record (handles, scene data, etc.).

      Returns ParticleOutputs

      Pass-specific output record (typically a set of handles downstream passes will consume).