https://github.com/pavelkouril/unity-marching-cubes-gpu
GPU ComputeShader implementation of Marching Cubes algorithm
https://github.com/pavelkouril/unity-marching-cubes-gpu
compute-shader marching-cubes unity
Last synced: about 1 year ago
JSON representation
GPU ComputeShader implementation of Marching Cubes algorithm
- Host: GitHub
- URL: https://github.com/pavelkouril/unity-marching-cubes-gpu
- Owner: pavelkouril
- License: mit
- Created: 2017-04-06T06:57:58.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-23T12:44:18.000Z (almost 9 years ago)
- Last Synced: 2025-04-24T03:47:30.255Z (about 1 year ago)
- Topics: compute-shader, marching-cubes, unity
- Language: C#
- Size: 37.1 KB
- Stars: 74
- Watchers: 5
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Marching Cubes GPU implementation for Unity
Developed with Unity 5.6, might work on older versions as well. No guarantee tho. Requires DX11 hardware. Not honestly sure about mobile phones, but my guess is it won't work. Feel free to correct me.
The generating of density field is done on CPU, but for demonstration purposes it should be enough. You will probably want to modify the `MarchingCubes.DensityTexture` from `Texture3D` to `RenderTexture` in a real application.
`ProceduralGeometry` shader used for drawing the MC is barebone and contains only diffuse lightning; replace it with a custom one, modified to your liking. :)
Any pull requests and issues are welcome.
## Credits
Implementing this would not be possible without:
- The algorithm and lookup tables by Paul Bourke
- The gradient normals calculation
- Vilém Otte , and his debugging/troubleshooting skills