Voxel terrain smoothing

Started by
3 comments, last by WhoCarrot 8 years, 7 months ago

Hello guys,

I recently started developing a game in unity. I have some questions and unclear areas in the department of terrain generation.

What I want to accomplish is a procedurally generated destructible world with smooth voxels.

It would be nice to have the possibility to have calm and flat areas in the starting zone but as you wander out the terrain would get some more interesting.

In the game you can control units, if you send them into a (yet) ungenerated chunk, they will start walking there and there would be enough time to generate the terrain in the background.

The step process that seems logic to me would be to;

Generate noise based on seed and coordinates

I've read about the different kinds of noise you can use and what the pro's and cons are, but I wanted to get something straight, the result after noise generation should be an array with values between (-1..1) or (0..1) if normalized, right?

Generate voxels based on the noise and map them in chunks

How does this actually work, I understand the big picture but when I'm working with an array of numbers between (-1..1) I kind of lose track of how to implement it code-wise.

Smooth the terrain out

This is the point that I find hardest because it gets really mathematical.

I have found some sources but most of them are really outdated, I was wondering if there are some recent and optimized terrain smoothing algorithms.

I've looked a lot at this article:

http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html

The terrain is too rough though, would it be possible to implement the smoothing with my own noise and voxels?

TL;DR: I'm developing a game which needs a procedurally generated destructible word with smooth voxels, I could use some pointers, recent articles and source codes in C# (preferred) with that.

Thanks a lot for helping me out, I'm looking forward to your replies!

Greetings,

WhoCarrot

Advertisement

It is unclear if you want to smooth the terrain or the voxel presentation of the terrain.

For smoothing terrain look up gaussian blur. For smoothing voxels look up marching cubes.


I've looked a lot at this article:

http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html

The terrain is too rough though,

If this is too rought, then you have some really demanding goals. Voxel worlds are notoriously memory hungry. For more memory efficient implementation look up sparse voxel/octtrees.

Thank you for replying and trying to help me.

It is unclear if you want to smooth the terrain or the voxel presentation of the terrain.

I would like to smooth out the voxels, like marching cubes indeed.

I found this implementation:

http://paulbourke.net/geometry/polygonise/

So if I understand correctly, you provide the algorithm with an array of the isolevels of 8 corners of your voxels.

Furthermore you provide the isolevel, and the array in which the triangles will be stored.

I am wondering what the isolevel is exactly and where it comes from (do you generate it with the noise per voxel?).

For further reference, the desired result looks something like this:

YeH6CXN.png

Thank you again for your help!

Greetings,

WhoCarrot

Check out marching squares (2d) first to get an understand of the approach.

Your screenshot:

This looks like standard (hi-resolution) height-mapped terrain. You will have a hard time to get this hi-resolution look for large terrain with voxels. A naive comparision is, that a terrain with 16bit height of the size of 4k x 4k would be roughly 32MB. The same in a voxel world with just one bit for each voxel would consume roughly 4 GB.


This looks like standard (hi-resolution) height-mapped terrain

I happen to know that this is voxelbased destructable terrain from a demo.

I believe it works with LOD's, here you can play that demo (in an earlier version):

https://dl.dropboxusercontent.com/u/13564422/WebPlayer/OctreeDemo.html

This topic is closed to new replies.

Advertisement