renderAgents.volume

A 3D swarm seen in perspective: nearer particles draw larger and brighter, and the color runs from rest to excited with speed.

renderAgents.volume(layout: Parameters<typeof splat.volume>[0] & RampResolveLayout, cfg: Omit<VolumeSplatConfig, 'names'> & {
            ramp: Omit<RampResolveConfig, 'name' | 'res' | 'invGain'>
            names: VolumeSplatConfig['names'] & {resolve: string}
            extraOnSplat?: boolean
        }): RenderAgentsPipelines

Import sim from shaders/std and use sim.agents.renderAgents.volume.

Parameters

NameTypeNotes
layoutParameters<typeof splat.volume>[0] & RampResolveLayout
cfg`Omit<VolumeSplatConfig, 'names'> & {
        ramp: Omit<RampResolveConfig, 'name' \| 'res' \| 'invGain'>
        names: VolumeSplatConfig['names'] & {resolve: string}
        extraOnSplat?: boolean
    }` |  |

Example

renderAgents.volume(simLayout, {shape, outRes: 1024, maxSplatSize: 12, extQ: 6, ramp: {colorSpace: 0, exposure: true, trails: 'none'}, names: {splat: 'swarmSplat', glow: 'swarmGlow', profile: 'swarmProfile', resolve: 'swarmResolve'}, extraOnSplat: true})

See also

  • renderAgents.orientedWorld — Agents with a heading, drawn as a shape pointing the way they move (or the way they are turned), colored from a rest color to an excited color.
  • renderAgents.relief — Particles standing on an image, seen through a camera: each carries the child's color at its home, and nearer particles win the color where they overlap.

Used by

Particles