It is currently Sat Aug 22, 2020 4:28 am


All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Flat Plane Tutorial
PostPosted: Thu Sep 12, 2013 6:24 am 
User avatar

Joined: Wed Jan 26, 2011 3:20 pm
Posts: 203
Location: Germany
David Williams wrote:
As for smoothing the data in the beginning I'm not so sure... even if you have a smooth heightmap the problem is that you are making a binary decision about whether each voxel is below or above the specified height. So each voxel is being set as completely empty or completely solid (so the get the stepped artefacts).


which is easy when everything is so steep that you have at least one height unit difference to the surroundings
you get the "solid" position and a higher up "empty" position (next to the surrounding voxels) and interpolate the values between those coordinates.

it gets hard when you try to smooth a very flat slope, because then you can't just look at your neighbors, you need to do way more.

and if your heightmap isn't smooth, then this method won't work either.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Flat Plane Tutorial
PostPosted: Fri Sep 13, 2013 7:55 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Ok, yes, I see what you mean.

ker wrote:
it gets hard when you try to smooth a very flat slope, because then you can't just look at your neighbors, you need to do way more.


I can see that a gentle slope is indeed difficult here (e.g. if it's flat for 10 voxels, then goes up one voxel, then is flat for another ten, and so on). You'd need a lot of blurring and this would destroy other details in you map.

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.

Just an idea... maybe it's worth research voxelising a mesh into a density field (rather than a 'binary' field)?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Flat Plane Tutorial
PostPosted: Fri Sep 13, 2013 12:58 pm 
User avatar

Joined: Sun Apr 14, 2013 12:47 am
Posts: 30
Location: Northern Tablelands, NSW, Australia
I wonder if you had a higher resolution heightmap, whether that could be used to create smooth meshes over large flat-ish areas (slowly sloping ground).

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.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Flat Plane Tutorial
PostPosted: Fri Sep 13, 2013 4:21 pm 
User avatar

Joined: Wed Jan 26, 2011 3:20 pm
Posts: 203
Location: Germany
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)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Flat Plane Tutorial
PostPosted: Sat Sep 14, 2013 4:44 am 
User avatar

Joined: Thu Sep 05, 2013 3:38 am
Posts: 51
Location: USA - Arizona
Thank you guys for all the help, here's my progress so far :)

Image

_________________
Dream Big Or Go Home.
ENet - http://enet.bespin.org
Recast - https://github.com/memononen/recastnavigation
Irrlicht - http://irrlicht.sourceforge.net/forum
PolyVox - http://www.volumesoffun.com/phpBB3/
Help Me Help You.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Flat Plane Tutorial
PostPosted: Tue Sep 17, 2013 8:37 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Right, sorry for the slow reply, had a busy weekend!

I think there's some interesting ideas here, and maybe it's also worth converting the input heightmap to a floating-point format for better interpolation and smoothing. I find this all quite hard to visualise though, so I look forward to trying to implement it myself.

@kklouzal - Looking good!


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net