How to implement voxel sculpting
figured maybe people that know what they're doing might be a good sort to ask since i obviously don't know what i'm missing when i searchj
23 Replies
ok so i like the idea of a super simple voxel sculpting app for standalone, main problem i have is how on earth to do the whole marching cubes thing to turn my point cloud into a mesh
any info i find is either a really loose overview of the concept, or an insane look into the math that makes me go cross-eyed, anyone know where i can find the "marching cubes for dummies" version?
"In what" would be the first question. You said you don't use Unity?
I don't think many people on this Discord know Unreal very well. That leaves Godot, webxr and various lesser known engines?
I guess the reason I wondered "what in" was because my next suggestion would be to explore existing libraries and built-in functionality to see if something can do the heavy lifting for you.
in godot, there is one voxel plugin but i'd like to build my ownpartly for the learning and parly just as a challenge
and i don't know what kind of customizability the plugin has, and if i'm gonna want to do something it doesn't already have functions for it'd help if i actually understood what was going on under the hood when i try to mess with it anyway
I'd start by generating simple geometric meshes. Once you understand that it's the basis for (nearly) all procedural generation in 3d
i get how the mesh generation in godot works already, i just don't get the marching cubes algorithm cause it's always either explained as "oh it checks cubes to see what's there and make a mesh" or it's a big long pile of math, i was hoping there were resources that had a bit of an in-between lol
one thing to not is that marching cubes is probably the ugliest of the options for meshing a volume. dual contouring usually looks nicer and surface nets are often faster - but everyone seems to go with marching cubes for some reason
boris the brave has a nice tut on dc: https://www.boristhebrave.com/2018/04/15/dual-contouring-tutorial/
Boris
BorisTheBrave.Com
Dual Contouring Tutorial
How to create a sharp mesh from a function without even trying In part 1 and part 2 of the series, we looked at the Marching Cubes algorithm, and how it can turn any function into a grid based mesh…
yeah that looks a lot more approachable, and saves me having to try doing some smoothing by normals after making teh mech with marching cubes
oh shit it also solves the problem everyone has with voxel sculpting, the lack of sharp edges
kinda - it does better than marching cubes
this is pretty good at that: https://libfive.com/
the fact that it can keep some sharp edges is a pretty big improvement
DC is harder to implement than marching cubes.
really? i'd have thought matrching cubes would be harder since it seems to just be guessing at the mesh for a while lol
hmm i might actually be able to use the python code the guy linked to as a bit of a blueprint in godot, GDscript is based on taking ideas from python and lua
eventually you probably want to do this on the gpu - or at least a fairly "close to the metal" language with multithreading
assuming you want to do this at runtime.
GDscript has multithreading
yeah but it's not a fast language
even c# is a bit of a slouch for this kind of thing
also since i'm aiming this at standalone headsets there's no GPU to use
yes there is
what do you think handles the graphics!
some techwizardry with an intergrated graphics thing? lol
integrated is still a gpu
either way, if GDscript ends up limiting what can be done too much i can still use godot for the vr part and the ui then convert the meshing to c++ or something
GitHub
GitHub - SebLague/Godot-Marching-Cubes
Contribute to SebLague/Godot-Marching-Cubes development by creating an account on GitHub.
....how did that never come up when i googled "godot marching cubes"?
GitHub
GitHub - PierreBeur/naive-surface-nets-3d: 3D implementation of the...
3D implementation of the naive surface nets algorithm in Godot - PierreBeur/naive-surface-nets-3d