โœจ VFX & Particles

A particle system emits many small elements (sprites, points, or meshes) to simulate effects like fire, smoke, sparks, rain, explosions, and magic. Each particle typically has a lifetime, velocity, color, and size that evolve over time.

Key Concepts

  • Emitter โ€” the source that spawns particles. It defines the spawn rate, initial position, direction, and spread.
  • Lifetime โ€” how long each particle lives before being removed or recycled. Short lifetimes give snappy effects (sparks); long lifetimes give lingering ones (smoke).
  • Forces โ€” gravity, wind, turbulence, and attraction/repulsion that affect particle movement over time.
  • Billboarding โ€” rotating flat sprites to always face the camera, so they appear as volumetric elements rather than flat planes.
  • GPU particles โ€” for large particle counts, storing particle data in textures or buffer attributes and updating them in shaders is far more efficient than CPU-side updates.

For GPU-driven particles in Three.js, the underlying primitives are BufferGeometry with Float32Array-backed BufferAttribute and Points / PointsMaterial.

Libraries

Resources