NokiMo
MirceaKitsune
MirceaKitsune

patreon


Smooth voxel terrain in Godot 4.0?

I was going to focus on some Blender updates next but have been pretty excited about picking up Godot again. I'm trying the new 4.0 dev version which will hopefully be released sometime this year: It's a solid release and I can definitely see the improvements! There are some bugs causing random crashes and error message spam which will hopefully pass.

It's been a long time dream to create my own voxel based world. Not quite like Minecraft... similar in functionality but with far more detail and greater complexity. For terrain my goal was to use marching cubes to generate a polygon mesh with both straight (0* / 90*) as well as diagonal (45*) surfaces capable of using realistic HD textures. Needless to say actual world details remain a dream for the further future, like any project it has to start from the ground up, in this case a chunk based world generator.

Two developers in the Godot community were awesome enough to provide me with the right pointers and help. Most important of which was the base implementation of a marching cubes algorithm for GDScript, alongside a better understanding of threading for proper performance. I managed to update it to the 4.0 scripting system and obtain a working script, which I managed to crunch down to just 60 lines of code if we exclude the surface cases list. Preliminary tests showing promising results at remarkable speeds! This is a snippet of the cell generation code, should have more stuff worth showing soon.

Smooth voxel terrain in Godot 4.0?

Related Creators