Internal — obtain instances through
WebgpuRenderer.createParticleSimulation, which supplies the device,
the shared compute cache, and the registry unhook.
OptionalonDispose: () => voidReadonlycapacitySlots the device buffers hold.
Readonlyis@fourjs/particles' structural brand — a literal true.
ReadonlypositionsFlat x,y,z position lanes, capacity × 12 bytes — the buffer the §36
draw binds as the per-instance position stream (module header), and a
readable §82 buffer (readComputeBuffer) for diagnostics and tests.
ReadonlysystemThe emitting node's id this simulation is registered under.
ReadonlyvelocitiesFlat x,y,z velocity lanes, capacity × 12 bytes. Readable likewise.
Whether WgpuParticleSimulation.dispose has run.
Releases the four allocations (§83). Idempotent, safe after device
loss (destroy() on an invalidated buffer is a defined no-op), and
unhooks this simulation from the renderer's draw-time registry so a
later frame falls back to the CPU instance stream rather than binding
a destroyed buffer.
One integrator dispatch over the first count slots — params packed
whole (count as f32, the WP-R1.8 precedent), then the WP-R1.8 kernel
at particleIntegratorWorkgroups(count).
Optionalextras: {Copies slot from's position and velocity over slot to — four
recorded copies through the scratch (module header), one submit.
Writes one spawned particle's position and velocity into slot index —
two 12-byte writeBuffers from a reused staging triple (writeBuffer
copies at call time, so reuse is safe).
The device residency of one
simulation: "gpu"particle system — see the module header. Created byWebgpuRenderer.createParticleSimulation; the caller owns it and disposes it (§83, thecreatePickingServiceownership rule), and its buffers die with the device either way (a destroyed device makesdestroy()a defined no-op).