Sign in to follow this  

Unity Voxel terrain smoothing

This topic is 809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Edited by Ashaman73

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Edited by WhoCarrot

Share this post


Link to post
Share on other sites

This topic is 809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Forum Statistics

    • Total Topics
      628645
    • Total Posts
      2984023
  • Similar Content

    • By arash khalaqhdoust
      hey guys i hope you doing all well. last night i released my first game in google app store, i really appreciate you guys  to download it. and share your reviews about it
      the idea of game comes from mini hackgame of Bioshock.
       link of download:
      https://play.google.com/store/apps/details?id=com.RVBinary.piperist
      many thanks
    • By ForgedInteractive
      Who We Are
      We are Forged Interactive, a small team of like-minded game developers with the sole purpose of making games we love! Currently, we're progressing very quickly with our first project and there are plenty of opportunities and work for new interested programmers. With this project, our development platform is Unity 5.5.2 and C# as our behavioral language. Since this project is our first release, the game itself is a smaller project though progress is moving quickly. We are looking to finalize the current project and get started on future projects in the near future and are expanding our team to do so.
       
      Who We Are Looking For:
      Programmer Level Designer  
      About the Game
      Ours is the tale of two siblings, thrown into a world of chaos. Living in the shadow of their parents' heroic deeds and their Uncle's colorful military career, Finn and Atia are about to become the next force to shape our world. How will you rise through the ranks of Hereilla and what will be your legacy? Once defeated your enemies turn coat and join you in your adventures. Players can enjoy a range of troops and abilities based on their gameplay style which become more important as maps introduce more challenging terrain, enemies and bosses. Strong orc knights, dangerous shamans, and even a dragon are out on the prowl. Knowing when to fight and when to run, and how to manage your army is essential. Your actions alone decide the fate of this world.
       
      Previous Work by Team
      Although we are working towards our first game as Forged Interactive, our team members themselves have worked on titles including and not limited to:
      Final Fantasy Kingsglaive FIFA 2017 Xcom 2 Civilization  
      What do we expect?
      Reference work or portfolio. Examples what have you already done and what projects you have worked on academic or otherwise. The ability to commit to the project on a regular basis. If you are going on a two-week trip, we don't mind, but it would be good if you could commit 10+ hours to the project each week. Willingness to work with a royalty based compensation model, you will be paid when the game launches. Openness to learning new tools and techniques
       
      What can we offer?
      Continuous support and availability from our side. You have the ability to give design input, and creative say in the development of the game. Shown in credits on websites, in-game and more. Insight and contacts from within the Industry.
       
      Contact
      If you are interested in knowing more or joining, please email or PM us on Skype. A member of our management team will reply to you within 48 hours.
       
      E-mail: Recruitment@ForgedInteractive.com
      Skype: ForgedInteractive
       
      Regards,
      David, Colin and Joseph
       
      Follow us on:
      Facebook: https://www.facebook.com/ForgedInteractive/
      Twitter: @ForgedInteract
      Youtube: https://www.youtube.com/channel/UCpK3zhq5ToOeDpdI0Eik-Ug?view_as=subscriber
      Reddit: www.reddit.com/user/Forged_Interactive

    • By dell96
      I'm trying to make my first project but I'm stuck i don't know how to make my crate to start to spawn again when i hit the start button after i die.
      hoping someone can help!!!
      Crate.cs
      CrateSpawn.cs
      Cratework.cs
      GameController.cs
      GameManager.cs
  • Popular Now