Back to skills
SKILL.md
Three Quarks
ASecurityAdd particle effects and VFX to three.js games with three.quarks (MIT): BatchedRenderer, ParticleSystem, emitter shapes, over-life behaviours, billboard/stretched/mesh/trail render modes, flipbook sprite sheets, effects designed in the quarks.art visual editor and loaded from JSON with QuarksLoader, React Three Fiber via quarks.r3f, and Unity Shuriken import. Use when a three.js or R3F project needs fire, smoke, explosions, magic, hit sparks, trails, rain or dust, or mentions three.quarks, qu...
- 2 stars
- 0 votes
- 0 copies
- 0 views
- Added November 22, 2026
Security analysis
92/100- Installs packages at runtime which could introduce malicious dependencies
Pro scans all 2 files and shows the line behind each finding
npx -y skills add jasonmello/pixelstrata --skill three-quarks --agent claude-codeAre you the author of Three Quarks?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/jasonmello-three-quarks)---
name: three-quarks
description: >
Add particle effects and VFX to three.js games with three.quarks (MIT): BatchedRenderer,
ParticleSystem, emitter shapes, over-life behaviours, billboard/stretched/mesh/trail render
modes, flipbook sprite sheets, effects designed in the quarks.art visual editor and loaded from
JSON with QuarksLoader, React Three Fiber via quarks.r3f, and Unity Shuriken import. Use when a
three.js or R3F project needs fire, smoke, explosions, magic, hit sparks, trails, rain or dust,
or mentions three.quarks, quarks.r3f, BatchedRenderer or quarks.art.
---
# three.quarks
[three.quarks](https://github.com/Alchemist0823/three.quarks) (MIT) is a high-performance
particle and VFX library for three.js, written in TypeScript. Version **0.17.1**. It needs
`three >= 0.182`. A batched renderer keeps draw calls low. Effects can be designed in the visual
editor at [quarks.art/create](https://quarks.art/create) and loaded from JSON.
## When to use
- A three.js or React Three Fiber game needs VFX: muzzle flashes, explosions, fire, smoke, magic,
trails, weather, pickups.
- Porting particle systems from Unity (Shuriken import).
**Not this skill:** the scene, camera and render loop → `threejs-scene-setup`; materials →
`threejs-materials-lighting`; Godot particles (GPUParticles) → Godot skills; designing the feel
of an impact → `game-feel`. Pixel-art flipbooks for the effect texture → PixelLab
`vfx_workbench` via `pixelstrata`.
## Workflow
1. `npm install three.quarks` (and `quarks.r3f` for React Three Fiber). Check the project's
`three` version meets the peer dependency.
2. Create **one** `BatchedRenderer`, add it to the scene, and call `batchRenderer.update(delta)`
every frame.
3. Design the effect: in code for simple ones, or in the editor for anything artistic. Export
JSON to `public/effects/` or `assets/vfx/`.
4. Load, clone per use, auto-destroy one-shots (below).
5. Check performance with many effects live (`performance-optimization`).
## Patterns
**Setup and an emitter in code**
```js
import * as THREE from 'three';
import { BatchedRenderer, ParticleSystem, ConstantValue, IntervalValue, ConstantColor,
ConeEmitter, RenderMode, SizeOverLife, ColorOverLife, PiecewiseBezier, Bezier,
Gradient } from 'three.quarks';
const batch = new BatchedRenderer();
scene.add(batch);
const sparks = new ParticleSystem({
duration: 0.5, looping: false,
startLife: new IntervalValue(0.2, 0.5),
startSpeed: new IntervalValue(4, 8),
startSize: new IntervalValue(0.05, 0.15),
startColor: new ConstantColor(new THREE.Vector4(1, 0.8, 0.3, 1)),
maxParticle: 64,
emissionOverTime: new ConstantValue(0),
emissionBursts: [{ time: 0, count: new ConstantValue(30), cycle: 1, interval: 0, probability: 1 }],
shape: new ConeEmitter({ radius: 0.1, angle: Math.PI / 4 }),
material: new THREE.MeshBasicMaterial({ map: sparkTex, transparent: true,
blending: THREE.AdditiveBlending, depthWrite: false }),
renderMode: RenderMode.StretchedBillBoard,
speedFactor: 0.1,
});
sparks.addBehavior(new SizeOverLife(new PiecewiseBezier([[new Bezier(1, 0.8, 0.3, 0), 0]])));
scene.add(sparks.emitter);
batch.addSystem(sparks);
const clock = new THREE.Clock();
renderer.setAnimationLoop(() => { batch.update(clock.getDelta()); renderer.render(scene, camera); });
```
Check the `emissionBursts` and `speedFactor` field names against the installed version's
typings. The quick-start fields (`duration`, `looping`, `startLife`, `startSpeed`, `startSize`,
`startColor`, `maxParticle`, `emissionOverTime`, `shape`, `material`, `renderMode`) come from the
official README.
**Effects from the editor (JSON)**
```js
import { QuarksLoader, QuarksUtil } from 'three.quarks';
const loader = new QuarksLoader();
loader.load('effects/explosion.json', (effect) => { explosionTemplate = effect; });
function explodeAt(pos) {
const fx = explosionTemplate.clone();
fx.position.copy(pos);
scene.add(fx);
QuarksUtil.addToBatchRenderer(fx, batch);
QuarksUtil.setAutoDestroy(fx, true);
QuarksUtil.play(fx);
}
```
**React Three Fiber:** wrap the canvas content in `QuarksProvider` from `quarks.r3f` and use its
`<ParticleSystem ... autoPlay />` component with emitters and behaviours from `three.quarks`.
## Building blocks
- **Emitter shapes:** `PointEmitter`, `ConeEmitter`, `SphereEmitter`, `HemisphereEmitter`,
`CircleEmitter`, `DonutEmitter`, `RectangleEmitter`, `GridEmitter`, `MeshSurfaceEmitter`.
- **Behaviours:** SizeOverLife, ColorOverLife, SpeedOverLife, RotationOverLife,
Rotation3DOverLife, FrameOverLife (flipbooks), ForceOverLife, GravityForce, ApplyForce, Noise,
TurbulenceField, OrbitOverLife, LimitSpeedOverLife, ColorBySpeed, SizeBySpeed,
RotationBySpeed, WidthOverLength (trails), ApplyCollision, ChangeEmitDirection,
EmitSubParticleSystem (sub-emitters), ApplySequences.
- **Render modes:** BillBoard, StretchedBillBoard, HorizontalBillBoard, VerticalBillBoard,
Mesh, Trail.
- **Flipbooks:** set `uTileCount` / `vTileCount` (and `startTileIndex`, `blendTiles`) and add
`FrameOverLife`. This is how PixelLab/`vfx_workbench` spritesheets become 3D effects. Use
`THREE.NearestFilter` on the texture for a pixel-art look.
- Other options: `worldSpace` (particles stay behind a moving emitter), `prewarm`,
`softParticles`, `renderOrder`.
## Pitfalls (symptom → cause → remedy)
- **Nothing renders** → no `BatchedRenderer` in the scene, `addSystem`/`addToBatchRenderer`
missing, or `update` never called → check all three.
- **Particles freeze** → `batch.update(delta)` skipped while paused → keep calling it, or pass 0
deliberately.
- **Dark square edges** → no transparency or blending → `transparent: true`, additive blending,
`depthWrite: false`.
- **One-shot effects pile up** → clones never freed → `QuarksUtil.setAutoDestroy(fx, true)`.
- **Trail follows the ship rigidly** → local space → `worldSpace: true`.
- **Type errors after upgrading three** → peer range → match `three` to the version's peer dependency.
## References
- Docs and editor: https://quarks.art · demo: https://demo.quarks.art
- Related: `threejs-scene-setup`, `threejs-materials-lighting`, `game-feel`,
`performance-optimization`, `pixelstrata` (VFX textures).
*Examples are adapted from the [three.quarks README](https://github.com/Alchemist0823/three.quarks) (MIT, © 2019 Forrest Sun).*
Files in this skill
- SKILL.md
- agents/openai.yaml
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.