Skip to content

Releases: dgreenheck/threejs-particle-fluids

Release list

v0.2.0

Choose a tag to compare

@dgreenheck dgreenheck released this 28 Sep 18:26

A performance release. Every demo preset simulates faster, and preparing liquid surfaces is faster in every liquid preset, with the same results.

Speed (GPU time per frame at about 25,000 particles on an Apple M5 Pro, measured mid-run against v0.1.0)

Preset v0.1.0 v0.2.0 Change
Banana Blender 10.6 ms 5.1 ms −52%
Honey Bunny 8.1 ms 4.2 ms −48%
Soft Body Squeeze 7.6 ms 4.0 ms −47%
Buoyancy 6.9 ms 4.1 ms −41%
Water Drop 3.5 ms 2.2 ms −37%
Dam Break 5.4 ms 3.8 ms −30%
Tarp Runoff 7.2 ms 5.0 ms −31%
Velvet Drape 5.6 ms 4.0 ms −29%
Vortex Plume 3.0 ms 2.3 ms −23%
Liquid Marble 2.0 ms 1.7 ms −15%

Liquid surface preparation is 14–27% faster, with identical output.

What changed

  • Particle contacts are solved with one GPU thread per contact found, instead of eight per particle.
  • Neighbor searches and the fluid solver process particles in spatial order, so nearby threads share cached data.
  • Floating bodies share one boundary pass instead of one per body.
  • The honey viscosity solver computes its weights once per substep instead of in every sweep.
  • The neighbor grid rebuilds in fewer passes, and redundant reset passes are gone.
  • The liquid surface skips empty space.

Breaking change (low-level API): NeighborList stores lists by grid slot. Custom kernels now start with list.emitThread(), pass the returned row to list.forEach(row, …), and dispatch list.threadCount threads. HashGrid.counts is zero between rebuilds; readback() still reports counts. See Extending. Simulation and the material classes are unchanged.

Also

  • HashGrid.slotOf, optional labels on Accumulator and buildConstraintGroups, and names on every kernel for GPU captures.
  • New scripts for contributors: perf:profile, perf:ab, and perf:fingerprint.
  • The demo shows its version.

v0.1.0

Choose a tag to compare

@dgreenheck dgreenheck released this 28 Sep 18:25

The first release of Three.js Particle Fluids: GPU particle physics for three.js, simulated and rendered with WebGPU.

Materials

  • Liquids with Position Based Fluids: viscosity, vorticity, surface tension, adhesion, and an implicit viscosity solver for thick liquids such as honey.
  • Soft bodies with shape matching, from stiff to jelly-like, built from meshes.
  • Cloth with stretch, bending, tethers, wind, and pinning.
  • Smoke carried by heated, buoyant air.
  • Two-way coupling: bodies float, cloth gets wet, and everything collides through one shared particle system.

API

  • Simulation, which sizes particles from a budget, lays out every material, and draws them.
  • Low-level building blocks for custom scenes: ParticleSystem, SimLoop, the material classes, PrimitiveSet and SDFCollider colliders, and a documented Material interface for custom kernels.
  • Rendering for liquid surfaces, smoke volumes, and particles.

Requires three.js r184 and a browser with WebGPU. See the guide and the live demo.