Creating and handling voxel terrain

So I looked, and it seems that there are only voxel engines for generating terrain, not creating it by hand.

I haven’t ever done anything voxel based, even outside of Unity. So I don’t exactly know how the rendering is done, and therefore how I can create voxel terrain (what method to use). I tried looking around to help me understand how it works, but didn’t find anything particularly helpful.

I’m stuck in-between really professional and qualify voxel generation engines, and outdated tutorials that use Unity’s “cube” object as the terrain, and place each one individually (which I know is a horrible idea, both in terms of time and processing).

Does anyone have any tips or pointers on how to actually make a voxel based terrain and render it efficiently, rather than generate one with code?

The closest thing to a solution that I could find, was the “Remesh” modifier in Blender. However I need both the terrain and objects (which I will place individually), to be made up of evenly scaled voxels. And I think making the terrain and objects in different software will cause the scale to be different, and therefore difficult to work with.

I know of a lot of voxel modeling software, but none of them seem to be meant for hand-painting large terrain.

And just to clarify. I only need to make a terrain in voxels by hand, and that’s it (and also have it be easy on the rendering/processing). I don’t need the terrain to be destructible, or stuff be placed on it. I just need a quicker way of making a custom terrain than building it one voxel at a time.

To clarify further, I would need a way of being able to set the color of each voxel individually (not one by one, but being able to specify a color for each voxel). But if it means the whole process is going to be either a whole lot more difficult or time consuming, then not so much.

Bump.

Voxels can be a massive beast of intricacies. Assuming you only want cubes (voxels can be smooth… See dual contouring or marching cubes), this sounds like something you could probably write in a few hours as a kind of custom editor. It’s by no means trivial though, unless you’ve written this kind of stuff before.

The idea is to store the voxel buffers in chunks, then just check which ones have nonsolid blocks next to them. For each of the exposed faces you create a quad from two triangles using the Mesh class. For editing the terrain you’d need to add some export function that turns the mesh into one big .obj file or something. Simply offsetting the meshes in the chunks by their world position might be fine if you don’t want the final mesh to topologically connect. Voxel colours can be done with either a texture atlas + UV mapping the mesh or simply storing a Color32 in each voxel, then using Mesh.colors.

In terms of editing you could just raycast from the scene camera to the voxel mesh, get the chunk that point is in, and then the block that point is in. It’d be tedious to make a large terrain by hand using only single block editing though, so a sphere tool might be better. Same deal as with single blocks, but now you check which voxels are within a given radius of the hit point and set/delete those.

An alternative might be Paint3D. I’ve never used it but it can support up to 64MB file sizes, which may be enough depending on your terrain and voxel size. You’d have to write a reader for importing the files of whatever program you use though, if it doesn’t export meshes.