Question

I'm trying to create a 3D world consisting of voxels (cubes). I'm trying to smooth the world out but I need to keep some blocks "blocky". Marching Cubes is a very popular way of smoothing the world but I don't see a very good way of adding "blocky" cubes to them.

As I only use 1 or 0 as density, is there a simple way to simplify the world for normal blocks like in this video and keep "blocky" cubes like they are?

I'm aware of a number of other algorithms that allow sharp features and such. But as I only need 1 pass the mesh doesn't need to be smoothed completely, is there a better way to smooth this than by using one of the numerous much more complex algorithms?

Edit for clear up what I mean with smooth and "blocky" cubes:

I consider the mesh being shown in the video smooth. With "blocky" cubes I mean cubes with 90 degrees angles. These smoothed voxels aren't that smooth but it's enough for my purpose.

Was it helpful?

Solution

Assumption 1) The distinction between 'smooth' and 'square' sections will be based on display / in-game material type.

Assumption 2) The use of binary density is due to not actually storing density, rather storing (in some possibly compressed fashion) the identity or type of matter at each point.

Assumption 3) The mesh does not need to be manifold. (self-crossing is allowed, although holes shouldn't be).

Result: Separate mesh passes for each material. If the material is 'smooth-type', run marching cubes on it. If the material is 'blocky'-type, place some of the six quads around each point.

To maintain "solidity" (continuity of surface, without holes), the smooth pass must consider any solid an occupied space, while the block pass should ignore only cases where the face is a block (or continuously smooth material, but that requires an extra 8 points fed in to the check, which may be worse than carting about a pile of waste interior faces). To avoid duplication, the smoothed surface is only drawn if at least one of the 8 points is 'smooth-type', while the block pass draws if the center point is 'block-type'.

As far as I can tell, the problem of 3^8 arises from having a single pass with values on the corners. By adding a second pass (with points on the sides and center), only 2^6 + 1 cases need to be computed beyond the 2^8 already present in a marching cubes pass.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top