Particular Wells is a desktop-first WebGL2 particle sandbox inspired by Particul.
The current version is intentionally simple:
- Click to emit particle bursts
- Particles curve inward around a central well
- Crossing the inner collector consumes particles
- The UI shows collected count, throughput, active count, and spawned total
- A debug overlay exposes FPS, sim time, render time, and render downsampling
The performance-focused structure remains the same:
Particle simulation: packed typed arrays and a fixed simulation stepRendering: one WebGL2gl.POINTSdraw with point spritesUI/state: a small counter system and DOM overlay, separate from the sim loop
Canvas 2Dis simpler, but WebGL2 batches large particle counts much better.CPU simulation + GPU renderingkeeps the collector logic simple while still scaling well.Single-well gravityisO(n)and stable, unlike full n-body gravity.
Particles use a structure-of-arrays layout:
Float32Array:x,y,vx,vyUint8Array:kind
Collected particles are removed with swap-delete so the active range stays dense and iteration remains cache-friendly.
npm install
npm run devBuild:
npm run build