Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://conorpo.github.io/marching-cubes-webgpu/
CAP4720 Final Project (By Conor O'Malley & Nick Stuhldreher)
https://conorpo.github.io/marching-cubes-webgpu/
Last synced: 5 days ago
JSON representation
CAP4720 Final Project (By Conor O'Malley & Nick Stuhldreher)
- Host: GitHub
- URL: https://conorpo.github.io/marching-cubes-webgpu/
- Owner: conorpo
- Created: 2023-10-26T00:26:49.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-08T04:59:56.000Z (9 months ago)
- Last Synced: 2024-06-05T15:50:25.680Z (5 months ago)
- Language: JavaScript
- Homepage: https://conorpo.github.io/marching-cubes-webgpu/
- Size: 145 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-webgpu - Marching Cubes WebGPU - Marching cubes implementation, by [Conor O'Malley](https://github.com/conorpo) - [Repository](https://github.com/conorpo/marching-cubes-webgpu) (Demos / Safari)
README
# Marching Cubes
## Authors
- Conor O'Malley
- [Nick Stuhldreher](https://www.nickst.dev/)## Pipelines & Needed Resources
0. Noise Field Creation
- Creates a 3D noise texture- (Input) Permutation Table Buffer
- (Input) Noise Settings Buffer
- (Output) texture3d\ Noise1. Marching Cubes (Triangle Creation)
- Runs the marching cubes algorithm on the noise texture- (Input) texture3d\ Noise
- (Input) Settings Buffer
- (Input) Triangulation LUT Buffer
- (Input / Output) Storage Buffer for Indices
- (Input / Output) Storage Buffer for Indirect Args
- (Input / Output) Storage Buffer for Vertices2. Rasterization and Rendering
- Renders out the triangles with a basic shader- (Vertex Input) Vertex Buffer (position, normal)
- (Index Input) Index Buffer
- (Input) Render Settings12. Debug Noise (optional, replaces 2)
- Renders 2D slices of the noise texture to the screen
- (Input) texture3d\ Noise
- (Input) Settings Uniform Buffer## TODO
```
- support window and resolution resizing during runtime (done)
- translate the noise and the mesh based on position, so that we have an endless space, shouldnt affect performance at all (done)
- add some procedural / interesting coloring / texturing (done)
- add this one fps counter library that is really clean looking (done)
- add additional sim settings (done)
- store vertex buffers as seperate, so that they can be packed tightly (done)
- add debug timing info (done)
- setup auto build (done)
```## Final Notes
Ended up a bit more spaghetti'd than I'd like, but happy with the current state of it. Could gain some efficiency via frustrum culling or maybe rendering the noise offset by where the player is looking. The JavaScript object oriented style got a bit messy in the end, but it was a fun project to work on.## BindGroups Overview
| | BindGroup 0 | BindGroup 1 | BindGroup 2 | BindGroup 3 |
|----------------|--------------------------------------|-----------------------------------------------------------------------------|--------------|-------------|
| Compute Noise | PTable + Triangulation LUTs | Noise Texture + Noise Settings | | |
| Marching Cubes | PTable + Triangulation LUTs | Noise Texture, Marching Cube Settings, IndirectArgs; Vertex, Normal, Index Buffers | | |
| Rendering | Render Settings | | | |
| Debug Noise | Noise Texture + Settings | Settings | | |