Skip to content

DusanKovacevic94/Feed-The-Core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Particular Wells

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

Architecture

The performance-focused structure remains the same:

  • Particle simulation: packed typed arrays and a fixed simulation step
  • Rendering: one WebGL2 gl.POINTS draw with point sprites
  • UI/state: a small counter system and DOM overlay, separate from the sim loop

Why This Shape

  • Canvas 2D is simpler, but WebGL2 batches large particle counts much better.
  • CPU simulation + GPU rendering keeps the collector logic simple while still scaling well.
  • Single-well gravity is O(n) and stable, unlike full n-body gravity.

Data Layout

Particles use a structure-of-arrays layout:

  • Float32Array: x, y, vx, vy
  • Uint8Array: kind

Collected particles are removed with swap-delete so the active range stays dense and iteration remains cache-friendly.

Run

npm install
npm run dev

Build:

npm run build

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages