Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simbleau/nbody-wasm-sim
An N-body WebAssembly simulation using Web GPU
https://github.com/simbleau/nbody-wasm-sim
rust rust-lang simulation wasm webassembly webgpu wgpu wgpu-rs
Last synced: about 2 months ago
JSON representation
An N-body WebAssembly simulation using Web GPU
- Host: GitHub
- URL: https://github.com/simbleau/nbody-wasm-sim
- Owner: simbleau
- Created: 2022-07-01T22:28:19.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-01T02:07:56.000Z (about 2 years ago)
- Last Synced: 2024-10-10T20:16:34.690Z (2 months ago)
- Topics: rust, rust-lang, simulation, wasm, webassembly, webgpu, wgpu, wgpu-rs
- Language: Rust
- Homepage: https://simbleau.github.io/nbody-wasm-sim
- Size: 10.4 MB
- Stars: 199
- Watchers: 3
- Forks: 11
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
GPU N-body WASM Simulation
Click here to demo the simulation.
Authors: [@seabassjh](https://github.com/seabassjh), [@simbleau](https://github.com/simblau)
---
## 📖 Overview
This repository is a 2D N-body simulation of a dynamical system of bodies, under the influence of physical forces such as gravity. The simulation is written completely in Rust with WebGPU and WGSL shading, exported to WebAssembly. We deploy the demo with GitHub Actions.🔸 Simulations like these are common in astrophysics and are used to understand the evolution of large-scale universal structures.
---
# 🚀 Serve Locally
## Dependencies
- [Rust](https://www.rust-lang.org/)
- [trunk](https://trunkrs.dev/) (`cargo install trunk`)
- [wasm32-unkown-unknown](https://yew.rs/docs/getting-started/introduction#install-webassembly-target) (`rustup target add wasm32-unknown-unknown`)
## Serve
- Run: `trunk serve`
- Preview: [`http://localhost:8080/`](http://localhost:8080/)![Screenshot](https://user-images.githubusercontent.com/48108917/183275653-a2ee4f9c-a982-482e-8405-bd124d4bbcf5.png)
---
## 📁 Directories
- [__`assets`__](./assets/): directory contains textures and shaders.
- [__`src`__](./src/): directory contains the rust source code.---
## 🔏 License
This project is dual-licensed under both [Apache 2.0](LICENSE-APACHE) and [MIT](LICENSE-MIT) licenses.