Took some time to figure out the best approach to do this but I've got it now.
To start with I created components that are all the same size. I am using 16x16x16 components. The voxel terrain is 128^3 so dividing that evenly is 8^3 components. In this image there is 512 of them. The red are inactive and the green are active (they have a model the represents the surface). This posed a problem for very large terrains. I would need a component size small enough so that LOD and real-time
Instead of settling for one way only to voxelize a terrain I decide to make it possible to select between a few of them depending on what was required. They're are basically just two methods, forward or backward.
enum VoxelMethod {
VOXEL_METHOD_FORWARD,
VOXEL_METHOD_FORWARD_CONTOUR,
VOXEL_METHOD_BACKWARD,
VOXEL_METHOD_BACKWARD_CONTOUR
};
Forward starts with a parent node and checks each corner against some function that says if the corner is above or below some user defined surface.
For the past few months I've been working on Voxel Terrain for Ultra. I started by creating an octree whose parent node encapsulates the bounds for the entire terrain and must be a perfect cube with dimensions that are a power of two. This ensures all child nodes can be neatly subdivided. If a more rectangular terrain is required the octree creates more than one parent node to make up the rectangle.
The next step was to subdivide the parent node to a level where each node would represent