cdyk/ComputeStuff

code for marching cubes?

stowellt opened this issue ยท 8 comments

Thanks for making this library available! In the marching_cubes branch I noticed the methods are basically empty in mc.cu and I couldn't find any GLSL shaders that would use the histopyramid to position vertices. Is this code available? I'm very interested in using the HP5 algorithm for marching cubes, thanks.

cdyk commented

Hi, thanks for your interest!

Yes, indeed the marching cubes-branch is pretty empty. My plan was to re-implement HP5 marching cubes from scratch and releasing it with a very permissive license. The effort stranded at something as trivial that I haven't yet decided on what file format to read, I would prefer using reference data, but not have any extra dependencies for reader code nor implement an involved reader myself. :-)

But to your question: I have another implementation that is publicly available, though under GPL2 (and owned by my previous employer), see https://github.com/sintefmath/hpmc/tree/v2.0-development/src/cuhpmc .

I haven't touched it in 8 years, but I believe it was relatively functional. It also can generate indexed meshes (introducing the inverse HP traversal) if I recall correctly.

Thanks for the response, I didn't realize there was another HP5 implementation. I know there is an OpenGL based version of HPMC, but was thinking of converting the Cuda version of HP5 to OpenGL compute shaders. Just curious if you think this would be possible, or not worth the effort? I like the improved efficiency of HP5 but wanted to target non-Nvidia GPUs.

cdyk commented

Indeed it should be possible. Optimization target is much larger though.

You can find OpenGL HP5 travesal shaders in https://github.com/sintefmath/hpmc/tree/v2.0-development/src/cuhpmc/shaders .

What is missing from is the pyramid buildup, that is currently only available in CUDA, but in essence that only requires free reading and writing into a buffer. I believe useful stuff like warp-shuffle etc. are available through extensions to glsl. So it is definitely possible.

I really appreciate the feedback! Are there any example apps that use cuhpmc in https://github.com/sintefmath/hpmc/tree/v2.0-development ? The apps seem seem to all use glhpmc

Thanks again, closing this issue now

cdyk commented

ComputeStuff has a full re-implementation of HP5-based marching cubes in the MarchingCubes folder, both non-indexed and indexed versions. Isn't optimized yet, but should work correctly.

Thanks for all your work! I'm excited to dig into this more.