Zylann / godot_voxel

Voxel module for Godot Engine
Other
2.47k stars 229 forks source link

Is this module appropriate for handling simple voxel models? #304

Open lonevox opened 2 years ago

lonevox commented 2 years ago

I hoped this was a more general purpose voxel module but it seems geared towards terrain. I'd like to load a Magicavoxel file of a character and change its voxels during runtime, and I'm wondering if this is the right tool to use.

Zireael07 commented 2 years ago

There is already a different magicavoxel loader addon

lonevox commented 2 years ago

I'm aware, but I want to be able to change the voxels during runtime, which this module lets you do. It is also high performance so I'd rather use this if it is possible

Zylann commented 2 years ago

It's possible, though the available API lacks some stuff to make it more accessible, and optimizations in place are not geared toward this case. There are classes to parse a vox file, others to hold voxel data, and others to transform voxels into meshes. So in theory you can build something on top of that, but it's not as great as if there was a setup that would work out of the box as a character for example.

VoxelTerrain is the closest node to do this, but there are several steps to make it suitable as a replacement for MeshInstance (that means not as a root node, but just to hold visuals). Some of them require improvements of the module:

This will eventually get adressed over time. So far terrain is indeed the main focus because that's what I and other people used it for most of the time.

lonevox commented 2 years ago

Awesome, thanks for the in-depth response. Although it isn't a priority, this is definitely a feature I'd use if support were added for it. For the time being it looks like I'll have to hack together my own solution.