Clonkex wrote:
By higher resolution, I don't mean on the standard 2D XY plane, I mean maybe using a colour heightmap instead of a greyscale one. You'd have at least 65535 "steps" rather than 255, and I wonder if you could use them to set better density values....just a thought.
David Williams wrote:
Perhaps a better approach is to consider converting the heightmap into a mesh (at least conceptually), and then voxelising that mesh. Then you can consider exactly where that mesh intersects your volume and set the voxel densities to best represent this.
lets combine those two ideas:
1. convert the 8bit-heightmap to a 16bit-heightmap (simply left-bitshifting all values by 8)
2. create a boolean heightmap that has true for all pixels that have the same value as their neigbors
3. keep on smoothing all pixels marked in the bool heightmap until sufficiently satisfied
4. convert to heightmap
4.1 remember to check for very steep slopes (more than 1 voxel) and do some magic there (see my earlier post)