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
Tieguaili
TieguailiOP6mo ago
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?
andybak
andybak6mo ago
"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.
Tieguaili
TieguailiOP6mo ago
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
andybak
andybak6mo ago
I'd start by generating simple geometric meshes. Once you understand that it's the basis for (nearly) all procedural generation in 3d
Tieguaili
TieguailiOP6mo ago
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
andybak
andybak6mo ago
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
andybak
andybak6mo ago
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…
Tieguaili
TieguailiOP6mo ago
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
andybak
andybak6mo ago
kinda - it does better than marching cubes this is pretty good at that: https://libfive.com/
Tieguaili
TieguailiOP6mo ago
the fact that it can keep some sharp edges is a pretty big improvement
andybak
andybak6mo ago
DC is harder to implement than marching cubes.
Tieguaili
TieguailiOP6mo ago
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
andybak
andybak6mo ago
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.
Tieguaili
TieguailiOP6mo ago
GDscript has multithreading
andybak
andybak6mo ago
yeah but it's not a fast language even c# is a bit of a slouch for this kind of thing
Tieguaili
TieguailiOP6mo ago
also since i'm aiming this at standalone headsets there's no GPU to use
andybak
andybak6mo ago
yes there is what do you think handles the graphics!
Tieguaili
TieguailiOP6mo ago
some techwizardry with an intergrated graphics thing? lol
andybak
andybak6mo ago
integrated is still a gpu
Tieguaili
TieguailiOP6mo ago
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
andybak
andybak6mo ago
GitHub
GitHub - SebLague/Godot-Marching-Cubes
Contribute to SebLague/Godot-Marching-Cubes development by creating an account on GitHub.
Tieguaili
TieguailiOP6mo ago
....how did that never come up when i googled "godot marching cubes"?
andybak
andybak6mo ago
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
Want results from more Discord servers?
Add your server