MCPcopy Index your code
hub / github.com/Alchemist0823/three.quarks

github.com/Alchemist0823/three.quarks @v0.17.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.17.0 ↗ · + Follow
1,438 symbols 2,708 edges 173 files 153 documented · 11% updated 49d ago★ 9878 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

three.quarks ✨

npm npm-downloads build-size github discord

three.quarks is a high-performance particle system and visual effects library for three.js, written in TypeScript.

Create stunning real-time VFX for games, interactive experiences, and web applications with an intuitive API and powerful visual editor.

landing image

🎮 Try the Demo

▶️ Launch Live Demo - See three.quarks in action with interactive examples!

🔗 Quick Links

Resource Description
📖 Documentation Official website and guides
🎨 Visual Editor WYSIWYG particle effect creator
💬 Discord Community support and discussion

🚀 Why three.quarks?

  • High Performance - Optimized batch rendering minimizes draw calls
  • 🎮 Unity Compatible - Import particle systems from Unity's Shuriken system
  • 🎨 Visual Editor - Design effects visually with three.quarks-editor
  • 🔧 Flexible - Extensible plugin system for custom behaviors and emitters
  • Production Ready - Used in games and interactive applications

📦 Installation

npm install three.quarks

⚡ Quick Start

import * as THREE from 'three';
import {
    BatchedRenderer,
    ParticleSystem,
    ConstantValue,
    IntervalValue,
    ConstantColor,
    PointEmitter,
    RenderMode
} from 'three.quarks';

// 1. Create the batch renderer (manages all particle systems)
const batchRenderer = new BatchedRenderer();
scene.add(batchRenderer);

// 2. Define your particle system
const particles = new ParticleSystem({
    duration: 2,
    looping: true,
    startLife: new IntervalValue(1, 2),
    startSpeed: new ConstantValue(5),
    startSize: new IntervalValue(0.1, 0.3),
    startColor: new ConstantColor(new THREE.Vector4(1, 1, 1, 1)),
    maxParticle: 100,
    emissionOverTime: new ConstantValue(20),
    shape: new PointEmitter(),
    material: new THREE.MeshBasicMaterial({
        map: yourTexture,
        transparent: true
    }),
    renderMode: RenderMode.BillBoard
});

// 3. Add to scene and renderer
scene.add(particles.emitter);
batchRenderer.addSystem(particles);

// 4. Update in your animation loop
function animate() {
    const delta = clock.getDelta();
    batchRenderer.update(delta);
    renderer.render(scene, camera);
    requestAnimationFrame(animate);
}

📂 Loading VFX from JSON

Export effects from the visual editor and load them at runtime:

import { QuarksLoader, QuarksUtil, BatchedRenderer } from 'three.quarks';

const batchRenderer = new BatchedRenderer();
const loader = new QuarksLoader();

loader.load('effects/explosion.json', (effect) => {
    QuarksUtil.addToBatchRenderer(effect, batchRenderer);
    scene.add(effect);
});

scene.add(batchRenderer);

Playing Multiple Instances

// Clone and play the effect multiple times
const instance = loadedEffect.clone();
scene.add(instance);

QuarksUtil.addToBatchRenderer(instance, batchRenderer);
QuarksUtil.setAutoDestroy(instance, true); // Auto-cleanup when finished
QuarksUtil.play(instance);

✨ Features

🎬 Renderers

  • Billboard - Camera-facing sprites
  • Stretched Billboard - Velocity-aligned sprites
  • Mesh - 3D geometry particles
  • Trail - Ribbon trails behind particles

📐 Emitter Shapes

  • Point, Sphere, Hemisphere, Cone, Circle
  • Mesh Surface - Emit from 3D model surfaces
  • Grid - Structured emission patterns

🎭 Behaviors

  • Color over lifetime
  • Size over lifetime
  • Rotation over lifetime
  • Force fields
  • Orbital motion
  • Texture animation
  • Sub-emitters
  • Custom behaviors via plugin system

🎨 Materials

  • MeshBasicMaterial (unlit)
  • MeshStandardMaterial (PBR)
  • Configurable blending modes
  • Texture atlas support

🧪 Examples

Browse the examples folder or run locally:

npm install
npm run build
npm run examples

📦 Packages

This project is a monorepo with modular packages:

Package Description
three.quarks 🎯 Main package - Three.js particle system with batched rendering, shaders, and full VFX toolkit
quarks.core 🧱 Core library - Framework-agnostic math, behaviors, emitter shapes, and functions (zero dependencies)
quarks.nodes 🔮 Node system - Experimental node-based VFX with visual programming and WebGPU compute support
quarks.examples 🎮 Examples - Interactive demos showcasing particle effects and features
quarks.playground 🧪 Playground - Development sandbox for testing and experimenting with effects

🛠️ Editor

  • three.quarks-editor - Visual editor for creating and previewing particle effects with real-time preview and JSON export

📚 Resources

🗺️ Roadmap

  • 🔲 WebGPU rendering support
  • 🔲 WebAssembly particle simulation
  • 🔲 Node-based scriptable particle systems
  • 🔲 Cross-platform native plugins

📄 License

MIT

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 984
Class 199
Interface 165
Function 85
Enum 5

Languages

TypeScript100%

Modules by API surface

packages/quarks.nodes/types/index.d.ts186 symbols
packages/quarks.core/src/math/Vector3.ts72 symbols
packages/quarks.core/src/math/Vector2.ts55 symbols
packages/quarks.core/src/math/Vector4.ts51 symbols
packages/quarks.core/src/math/Matrix4.ts42 symbols
packages/three.quarks/src/ParticleSystem.ts39 symbols
packages/quarks.core/src/math/Quaternion.ts38 symbols
packages/quarks.nodes/src/nodes/NodeVFX.ts28 symbols
packages/quarks.core/src/util/LinkedList.ts28 symbols
packages/quarks.core/src/math/Matrix3.ts28 symbols
packages/quarks.core/src/math/MathUtils.ts22 symbols
packages/quarks.core/src/IParticleSystem.ts22 symbols

For agents

$ claude mcp add three.quarks \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page