WebGPU Powered

Particle Fluid Simulation

A spec-driven WebGPU reference project with 10,000+ particles, compute-shader physics, adaptive quality, and a polished browser demo you can inspect and extend.

10K+ Particles
60 FPS Target
GPU Accelerated

Features

Built with modern web technologies for maximum performance

GPU Compute Shaders

All physics calculations run in parallel on the GPU using WebGPU compute shaders for maximum performance.

Frame-Rate Independent

Physics uses delta time calculations, ensuring consistent simulation speed at any frame rate.

Adaptive Quality

Automatically detects device capabilities and scales particle count from 2,500 to 10,000 for optimal performance.

Visual Effects

Beautiful motion trails with velocity-based color mapping from cyan to purple based on particle speed.

Interactive Controls

Push particles with mouse or touch input. HiDPI-aware coordinate mapping for Retina displays.

Modern Stack

Built with TypeScript, Vite, WebGPU, and Vitest for a great developer experience.

Quick Start

Get the simulation running in under a minute

1

Clone the repository

git clone https://github.com/LessUp/particle-fluid-sim.git
cd particle-fluid-sim
2

Install dependencies

npm install
3

Run locally or open the hosted demo

npm run dev

For GitHub Pages, use /demo/. For local development, open http://localhost:5173.

Requirements

Node.js 18+ Chrome 113+ Edge 113+ Safari 17+