- Home
- Skills
- Bbeierle12
- Skill Mcp Claude
- Particles Lifecycle
particles-lifecycle_skill
- JavaScript
6
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill bbeierle12/skill-mcp-claude --skill particles-lifecycle- _meta.json357 B
- SKILL.md14.4 KB
Overview
This skill implements particle lifecycle management for JavaScript-based renderers, covering emission/spawning, death conditions, object pooling, trails, fade in/out and state-driven transitions. It provides both CPU and GPU-friendly patterns so you can build continuous emitters, bursts, shaped emission, trails, and memory-efficient pools for high-performance effects.
How this skill works
The code models each particle with position, velocity, life and alive state, updating them each frame and computing an age factor for fades and size/color curves. Emitters (continuous, burst, shape, cone) reuse dead particles via pools or GPU buffers to avoid allocations. Trails, sub-emitters and state machines add spawn/dying behavior and per-state fades.
When to use it
- Continuous effects like smoke, rain, or fire where new particles must spawn steadily.
- Burst or explosion effects that spawn many particles at once.
- Memory-sensitive applications where object pooling prevents GC spikes.
- Trail effects that require position history or shader-based trails.
- Complex behaviors where particles have spawn, active, dying, and dead states.
Best practices
- Pre-allocate particle objects or GPU buffers to avoid runtime allocations.
- Use an accumulator-based continuous emitter to keep spawn rate stable across variable frame delta.
- Choose GPU pools for very large counts and CPU pools for fine-grained per-particle logic.
- Drive fades, size and color with normalized age (0..1) and reuse easing curves for consistent look.
- Use state machines to separate spawn/die logic and make alpha/behavior decisions deterministic.
Example use cases
- A fountain that continuously emits droplets from a circular edge with gravity and fade-out.
- An explosion that uses a burst emitter then spawns smaller debris via sub-emitters on death.
- A racing game trail system storing recent positions per particle and rendering a line strip.
- Fire or smoke that blends color over life using a multi-stop gradient and eased fades.
- A large snowfall using a GPU particle pool for thousands of particles with minimal CPU cost.
FAQ
Pre-allocate a pool sized for peak demand and fall back gracefully when the pool is exhausted (skip spawns or reuse oldest live particle).
When should I use GPU pools instead of CPU objects?
Use GPU pools for very large counts or when per-particle logic can be expressed in shaders. Use CPU pools when particles need complex per-frame JS logic or hierarchical state machines.