Basic Concepts
Understanding the core concepts of threeparticles.
Particles
The Particles class is the main container that manages all particles. It extends THREE.Object3D so you can add it directly to your scene and transform it like any other object.
import { Particles } from "@threeparticles/core";
const particles = new Particles(config);
scene.add(particles);
particles.start();Configuration
Particle systems are configured through three main sections:
particles
Controls the visual appearance:
count- Maximum number of particlescolors- Color gradient over lifetimeintensity- Brightness multiplierfadeSize/fadeAlpha- Size and opacity transitionsgravity- World-space gravity forceappearance- Shape mode (square or circular)
emitter
Controls spawning behavior:
rate- Particles per emission cyclelifetime- How long particles live[min, max]speed/size- Velocity and scale rangesstartPositionMin/startPositionMax- Spawn volumedirectionMin/directionMax- Emission direction rangeloop- Whether to continuously emitspawnMode-"time"(gradual) or"burst"(all at once)
render
Controls WebGPU rendering:
blendingMode- Additive, normal, etc.depthTest- Z-buffer testingside- Front, back, or double-sided
Lifecycle
- Spawn - Particles are created with randomized properties within configured ranges
- Update - Call
particles.update(delta)each frame to animate - Recycle - When lifetime expires, particles are reused for new emissions
Control Methods
particles.start(); // Begin emitting
particles.pause(); // Pause (keeps state)
particles.stop(); // Stop and hide
particles.dispose(); // Clean up resources