Left-click to attract. Right-click for shockwave. Scroll to zoom.
WebGPU 100k Enemies Demo
This demo showcases a real-time simulation of 100,000 enemies entirely on the GPU using **WebGPU compute shaders**.
Features:
- **GPU-Accelerated Simulation:** All enemy movement, collision avoidance, and seeking behaviors are computed in parallel on the GPU.
- **Attraction:** Left-click on the canvas to set an attraction point.
- **Shockwave Attack:** Right-click for an expanding shockwave that "kills" enemies. Killed enemies respawn from the edges.
- **Camera Zoom:** Use the mouse scroll wheel to zoom in and out.
- **Obstacle Avoidance:** Enemies steer around static obstacles (gray circles).
- **Varied Enemy Types:** Enemies have different colors, sizes, and speeds.
- **Kill Counter:** Tracks enemies eliminated by attacks.
- **Procedural Background & Sprites:** Dynamic gradient background that flashes on attack, and a procedurally generated "duder" sprite for enemies.
- **Reset Simulation:** Button to reset the simulation.
Inspiration: This demo was inspired by the impressive 100,000 enemies in Godot showcase, demonstrating the power of modern graphics APIs for large-scale simulations.
Developed by **Trent "Tront" Sterling**.
Learn more at tront.xyz.