David Williams wrote:
In general I would avoid smoothing the mesh as it usually causes artifacts along the region boundaries (as you don't have access to the neighbouring region when smoothing). I have found it is much more effective to smooth the volume data instead.
I imagine that adding noise to the vertex positions look ok, but maybe it is too slow to redo it every time the mesh is regenerated.
What kind of geometry are you adding?
I did actually think of that issue and whilst I have no implementation of it, I thought there could be potential to solve that problem by snapping edge verts to the nearest edge vert of a neighbouring voxel mesh some time after extraction.
I don't know how well that'd work in practice though.
In terms of geometry, I'm basically looking for ways to get more out of the voxel data I have available to me. The resolution of the voxel data is basically 1 voxel is a wall. The wall could be a cave wall, stone cliff, paved wall, etc. The voxel has the wall type and material available as a variable so the information is there, I've just got to find an elegant way to render it.
I had originally thought I'd just create a bunch of tilable 3D models to piece together a scene, but I think that might be a very limiting way to go about it in terms of artistic direction:
How many models would I need to make up all the variations of wall/floor/stairs/ramp/etc?
How do I blend textures between models to create seamless transitions? Is this even possible?
If I render it as a mesh it becomes a lot more procedural. Some code can paint all the textures I want according to the material type I've got on the vertex.
David Williams wrote:
DJDD wrote:
Is there any way to keep the relationship between a voxel and its mesh components? So for example a voxel is turned to air can i cut a hole in my mesh and regenerate the surrounding 15 voxels to create a patch?
No, and I suspect that such an approach would be difficult an error prone.
I had assumed that would be the case. Thought I'd ask anyway. What about improving extraction run time after the first extraction? I would assume the majority of the time is spent iterating over all 4096 voxels in the region. If so, can you think of a way where I can store what I know to be the surface shell of the region as use it as a shortcut on the second+ runs?
This isn't terribly important right now for me - I need to get my solution working before I look at improving efficiency, but just thinking out loud.
David Williams wrote:
DJDD wrote:
Any other more elegant solutions?
Depending on what exactly you want to do, you could implement some effects in shaders. For example, you can add noise to the vertex position in the vertex shader. Geometry and tesselation shaders could also be useful.
This is true. Maybe that is the way forward. Do you have any further reading or existing open-source projects?
As an example, I need to turn a flat wall surface into a cave wall (rocky, and curved at the top to meet the roof).