It is currently Sat Aug 22, 2020 2:04 pm


All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: VolumeResampler and smooth LOD example.
PostPosted: Sat Jul 16, 2011 10:34 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Hey guys,

I've recently added a new class to PolyVox - the 'VolumeResampler'. This class provides a mechanism to copy data from a region in one volume to a region in a different volume. More importantly, it will scale the data if the source and destination regions are different sizes.

For those of you working with smooth surfaces (the marching cubes surface extractor) this is really the key component you have been waiting for to implement LOD directly on the volume, rather than using the slow and messy MeshDecimator. The idea is that you create a lower resolution version of the part of the volume data you are about to extract, and then running the surface extractor on this lower resolution volume data gives a lower resolution mesh.

I've added a simple example to PolyVox showing how this can be used for smooth LOD puposes but it's still rather work-in-progress. It only handles density volumes at the moment (no materials) and the example is full of magic numbers. I'll clean it up over the coming days, but it looks something like this:

Image

In the example I have chosen to overlap the LOD levels slightly.The two LOD levels may not line up exactly, and overlapping them would be one way of avoiding any cracks. You don't have to do this in your application though.

Hope you find it useful!


Top
Offline Profile  
Reply with quote  
 Post subject: Re: VolumeResampler and smooth LOD example.
PostPosted: Sun Jul 17, 2011 11:49 am 
Developer
User avatar

Joined: Sun May 11, 2008 4:29 pm
Posts: 198
Location: UK
Looks good. I guess the possibility for seam effects at boundaries won't matter too much since on the whole this will be used for far distant regions.

_________________
Matt Williams
Linux/CMake guy


Top
Offline Profile  
Reply with quote  
 Post subject: Re: VolumeResampler and smooth LOD example.
PostPosted: Sun Jul 17, 2011 7:52 pm 

Joined: Wed Apr 27, 2011 7:10 am
Posts: 43
Are you sure this solves the crack problem in all cases? In my own tests, I noticed that a sphere does not exhibit the crack problem IIRC.

_________________
irc://irc.freenode.net/#polyvox


Top
Offline Profile  
Reply with quote  
 Post subject: Re: VolumeResampler and smooth LOD example.
PostPosted: Mon Jul 18, 2011 9:42 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
realazthat wrote:
Are you sure this solves the crack problem in all cases?


No, definitely not. I'm simply claiming that it might help the crack problem in some cases. I'm not using the smooth surface extractor for my current project so I haven't tested it on anything more complex than the sphere above. But if a complex terrain does suffer from cracks, and if they are improved by overlapping the meshes a certain amount, then it is easy to generate such overlapping meshes with the approach above. But the overlapping is completely optional.

I should point out though that the VoumeResampler doesn't exist just for generating LOD meshes - that was just one application which I know people have asked about in the past. Personally I will be using it for creating a lower resolution volume for calculating ambient occlusion, and I'm sure it will find other applications as as well. It's a general purpose tool really, and I think I'll be adding other kinds of filters in the future.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 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