Skip to content

fangde/genesis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 

Repository files navigation

Genesis โ€” WebGPU 3D Physics Simulation

An interactive 3D physics simulation environment powered by WebGPU with real-time gravity, collisions, and dynamic object spawning.

WebGPU Three.js Physics

โœจ Features

  • WebGPU Rendering โ€” Cutting-edge GPU-accelerated graphics via Three.js WebGPU renderer
  • Real-time Physics โ€” Gravity, collisions, friction, and bounciness powered by cannon-es
  • Interactive Spawning โ€” Click on the ground or press Space to spawn objects
  • Multiple Shapes โ€” Cubes, spheres, and cylinders with randomized colors
  • Adjustable Parameters โ€” Gravity, object scale, and bounciness sliders
  • Auto-spawn Mode โ€” Toggle continuous object rain
  • Visual Effects โ€” Glowing spawn animations, dynamic colored lights, ambient particles
  • Sci-fi Aesthetic โ€” Dark theme with glassmorphism UI and cyan grid floor

๐Ÿš€ Getting Started

Prerequisites

A browser with WebGPU support:

  • Chrome 113+ (enabled by default)
  • Edge 113+ (enabled by default)
  • Firefox Nightly (with dom.webgpu.enabled flag)

Run Locally

Since the app uses ES modules, it needs to be served over HTTP:

# Using npx (no install needed)
npx serve .

# Or Python
python -m http.server 3000

# Or any static file server

Then open http://localhost:3000 in your browser.

๐ŸŽฎ Controls

Input Action
๐Ÿ–ฑ๏ธ Click ground Spawn object at cursor
โŒจ๏ธ Space Spawn random object
โŒจ๏ธ R Reset scene
๐Ÿ–ฑ๏ธ Drag Orbit camera
๐Ÿ–ฑ๏ธ Scroll Zoom in/out

๐Ÿ› ๏ธ Tech Stack

  • Three.js (WebGPU renderer) โ€” 3D rendering
  • cannon-es โ€” Physics engine
  • Vanilla HTML/CSS/JS โ€” Zero build step

๐Ÿ“„ License

MIT

About

Interactive 3D physics simulation powered by WebGPU

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages