Skip to content

Repository files navigation

WebGPU Particle Simulator

A GPU-accelerated N-body particle simulation using WebGPU. Simulates gravity and collisions between thousands of particles in real-time.

Features

  • N-body gravitational simulation with 1000s of particles
  • Particle collisions and merging with conservation of momentum
  • GPU-accelerated computation using WebGPU compute shaders
  • Interactive 3D camera controls
  • Billboarded particle rendering with size and color based on mass

Technical Details

  • WebGPU for GPU compute and graphics
  • WGSL shaders for particle physics and rendering
  • Compute shader handles particle updates in parallel
  • Point sprite rendering with geometry generated in vertex shader

Try it

Requires a browser with WebGPU support (e.g. Chrome).

Controls

  • Click and drag to rotate view
  • Mouse wheel to zoom

Demo

Screen.Recording.2024-11-05.at.00.41.20.mov

About

WebGPU-based particle simulation. Gravity and collisions computed by the GPU.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages