-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Separated physics logic Co-authored-by: Spencer C. Imbleau <spencer@imbleau.com> * Code cleanup Co-authored-by: Sebastian Hamel <sebastian.hamel@rockets.utoledo.edu> * Fixed astro burping Co-authored-by: Sebastian Hamel <sebastian.hamel@rockets.utoledo.edu> * Finished web document styling Co-authored-by: Sebastian Hamel <sebastian.hamel@rockets.utoledo.edu> * Decreased font size Co-authored-by: Sebastian Hamel <sebastian.hamel@rockets.utoledo.edu> * Final constant tweaks Co-authored-by: Spencer C. Imbleau <spencer@imbleau.com> * Added dynamic color scaling Co-authored-by: Sebastian Hamel <sebastian.hamel@rockets.utoledo.edu> * Fixed x sampling for texture UVs Co-authored-by: Spencer C. Imbleau <spencer@imbleau.com> * Rave mode in state Co-authored-by: Sebastian Hamel <sebastian.hamel@rockets.utoledo.edu> * Rave mode complete Co-authored-by: Spencer C. Imbleau <spencer@imbleau.com> * Added instructions Co-authored-by: Sebastian Hamel <sebastian.hamel@rockets.utoledo.edu> * Rave shader finished Co-authored-by: Spencer C. Imbleau <spencer@imbleau.com> * clean up * Modified README * Necessary emoji * Added renovate, actions * Updated README * Fixed build GitHub Action * Changed Action name * Finished GitHub Actions workflows * Updated dependencies, workflows Co-authored-by: Sebastian Hamel <sebjfk@gmail.com> Co-authored-by: Sebastian Hamel <sebastian.hamel@rockets.utoledo.edu>
- Loading branch information
1 parent
63d1c46
commit c63a6d5
Showing
27 changed files
with
490 additions
and
259 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# These are supported funding model platforms | ||
|
||
github: [simbleau] | ||
custom: ["buymeacoffee.com/simbleau"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": [ | ||
"config:base" | ||
], | ||
"packageRules": [ | ||
{ | ||
"matchUpdateTypes": [ | ||
"minor", | ||
"patch" | ||
], | ||
"automerge": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
env: | ||
TOOLCHAIN: nightly | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Cargo cache | ||
- name: Cargo cache | ||
id: cache-cargo | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cargo/bin | ||
key: cargo | ||
|
||
# Install cargo deps | ||
- name: Pull Cargo dependencies | ||
if: steps.cache-cargo.outputs.cache-hit != 'true' | ||
run: | | ||
rustup update $TOOLCHAIN | ||
rustup default $TOOLCHAIN | ||
cargo install trunk | ||
# Pull website | ||
- name: Build cache | ||
id: cache-build | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./dist | ||
key: dist-${{ hashFiles('./src') }}-${{ hashFiles('./assets') }} | ||
|
||
# Install cargo deps | ||
- name: Trunk build | ||
if: steps.cache-build.outputs.cache-hit != 'true' | ||
run: | | ||
trunk build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
||
env: | ||
TOOLCHAIN: nightly | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Pull website | ||
- name: Build cache | ||
id: cache-build | ||
uses: actions/cache@v3 | ||
with: | ||
path: ./dist | ||
key: dist-${{ hashFiles('./src') }}-${{ hashFiles('./assets') }} | ||
|
||
# Install cargo deps | ||
- name: Trunk build | ||
if: steps.cache-build.outputs.cache-hit != 'true' | ||
run: | | ||
rustup update $TOOLCHAIN | ||
rustup default $TOOLCHAIN | ||
cargo install trunk | ||
trunk build --release | ||
# Deploy, GitHub Pages | ||
- name: Deploy | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,46 @@ | ||
# GPU-Accelerated 2D N-Body Simulation, in WASM | ||
An N-body WebAssembly simulation using WebGPU. | ||
<div align="center"> | ||
|
||
# Run | ||
- `trunk serve` | ||
<h1>GPU N-body WASM Simulation | ||
</br> | ||
<a href="https://www.rust-lang.org/"><img src="https://simpleicons.org/icons/rust.svg" width="50px" height="50px"/></a> | ||
+ | ||
<a href="https://www.rust-lang.org/what/wasm"><img src="https://simpleicons.org/icons/webassembly.svg" width="50px" height="50px"/></a> | ||
+ | ||
<a href=""><img src="https://wgpu.rs/logo.min.svg" width="50px" height="50px"/></a> | ||
</h1> | ||
|
||
# Progress | ||
In progress. Currently a research project of [@seabass247](https://github.com/seabass247) and [@simbleau](https://github.com/simbleau). | ||
<h2>Click here to demo the simulation.</h2> | ||
|
||
![image](https://user-images.githubusercontent.com/48108917/181005443-a6c96151-b7b9-4dee-8ba3-0aaf814ac2c9.png) | ||
</div> | ||
|
||
--- | ||
|
||
## 📖 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.