glitch

emergent particle life

capabilities

Powered by WebGPU

100k particles

Simulate up to one hundred thousand individual particles simultaneously, each with unique state and behavior.

6 particle types

Define distinct species with custom interaction rules. Watch emergent patterns form as types attract and repel.

Rule matrix

A configurable 6×6 attraction–repulsion matrix governs inter-type forces, enabling complex flocking and self-organization.

WebGPU compute

All simulation logic runs on the GPU via WebGPU compute shaders for maximum parallelism and performance.

Real-time

Interactive frame-by-frame rendering with responsive controls. Tweak parameters and see results instantly.

Pattern Presets

Switch between 7 curated rule sets — Cells, Worms, Galaxy, Jelly, Crystals, Chaos or your own custom matrix.

Mouse Interaction

Drag on the simulation to attract particles toward your cursor. Watch the flock follow your hand.

Open source

MIT-licensed. Fork, modify, and experiment freely. Contributions and new particle life discoveries welcome.

workflow

How it works

Initialize the universe

Distribute thousands of particles across a 2D field, each assigned one of six types with random initial positions and velocities.

Compute interactions

For each particle, the GPU evaluates attraction or repulsion from every nearby particle based on the configurable rule matrix.

Watch life emerge

Simple local rules produce complex global patterns — flocking swarms, oscillating clusters, and stable orbiting structures.

get started

Install & run

Clone
git clone https://github.com/kvnlnk/glitch.git
cd glitch
Install
npm install
Run
npm run dev
Build for production
$ npm run build $ npm run preview