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


All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Using Octrees
PostPosted: Fri Feb 07, 2014 4:37 am 

Joined: Thu Feb 06, 2014 3:02 am
Posts: 14
I don't believe I saw any Octree inside the source of PolyVox. I would recommend using one, as it can be very useful, here's a small list.

First, an Octree can be used as a 3D grid (yes, I know PolyVox has the volumes which are 3D grids already), but the advantage here is that it can compress voxels and load/store them in near real time to real time (just depends how you build up the structure of it)

Next, you can use Octrees to cut down the amount of Polygons you use per mesh. This is done by taking the root node and iterating through each of it's 8 branches and checking each of those ect. until you get to leaf nodes and then you can render the leaf node based on it's depth inside the Octree compared to the overall size of the Octree (e.g if the max size of the octree is 64 voxels in each dimension and you and the current leaf node has a depth of 2, you just take 64x64x64 / 2x2x2, which equals 32x32x32)

I'm sorry, I'm not the best person to explain things like this, but here's a link of what one can do:
Also note that this YouTube video is not mine, I just find it amazing
http://www.youtube.com/watch?v=km0DpZUgvbg


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Using Octrees
PostPosted: Mon Feb 10, 2014 9:22 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Hi, octrees are indeed interesting. But you're right that they are not really used in PolyVox at the moment. However, we have used them a bit for LOD in Cubiquity (our higher-level voxel engine which is built on top of PolyVox). This was mostly just an experiment but hopefully we'll work on it some more in the future.

Image

Over Christmas Matt also talked to me about Dual Contouring and octrees are again relevant here... it's quite possible some extra stuff will move into PolyVox as a result.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Using Octrees
PostPosted: Tue Feb 11, 2014 12:13 am 

Joined: Thu Feb 06, 2014 3:02 am
Posts: 14
David Williams wrote:
Hi, octrees are indeed interesting. But you're right that they are not really used in PolyVox at the moment. However, we have used them a bit for LOD in Cubiquity (our higher-level voxel engine which is built on top of PolyVox).[/qoute]

Well, luckily you understand what I meant, I am horrible at explaining things.

David Williams wrote:
This was mostly just an experiment but hopefully we'll work on it some more in the future


If you need help, I can certainly lend a hand, I've been working with Octrees for a bit and made a version, but I never could get to apply the Octree to a Marching Cubes/Dual Contouring Mesh, although it did work well on a Cubic Mesh.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Using Octrees
PostPosted: Tue Feb 11, 2014 8:36 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Am am interested in Octrees, but overall I would like to focus on a thread-safe volume first. Of course, the two are not mutually exclusive but it's easier to tackle one at a time ;-)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Using Octrees
PostPosted: Wed Feb 12, 2014 12:09 am 

Joined: Thu Feb 06, 2014 3:02 am
Posts: 14
David Williams wrote:
Am am interested in Octrees, but overall I would like to focus on a thread-safe volume first. Of course, the two are not mutually exclusive but it's easier to tackle one at a time ;-)


Actually, I'm looking for the thread-safe volumes more, because I just noticed today when trying to use multi-threading that it failed quite horribly.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Using Octrees
PostPosted: Thu Feb 13, 2014 8:39 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Do check out this (limited) information: http://www.volumesoffun.com/polyvox/doc ... ading.html

An improved volume really is edging closer as we want one for Cubiquity, but there's just a few other things to get out of the way first...


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Using Octrees
PostPosted: Fri Feb 14, 2014 12:56 am 

Joined: Thu Feb 06, 2014 3:02 am
Posts: 14
David Williams wrote:
Do check out this (limited) information: http://www.volumesoffun.com/polyvox/doc ... ading.html

An improved volume really is edging closer as we want one for Cubiquity, but there's just a few other things to get out of the way first...


I'll be sure to check this out, I'm sure I could scratch together something that would work.

In theory, I assume volumes aren't thread-safe because of the possibility of it being modified while another thread is accessing it, but if I were to make a check to see if it's in use, and only do the operations if it's not being modified/read would this make it thread safe?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Using Octrees
PostPosted: Sat Feb 15, 2014 10:04 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Hansiec wrote:
In theory, I assume volumes aren't thread-safe because of the possibility of it being modified while another thread is accessing it, but if I were to make a check to see if it's in use, and only do the operations if it's not being modified/read would this make it thread safe?


In the case of SimpleVolume I think this should make it thread-safe, though I think you can get away with simultaneous reads anyway. In the case of LargeVolume it's a little more complex, as accessing a voxel can potentially cause another voxel to get paged out of memory. This is the first thing I'd like to address in a new system.

It does need some more research before I fully understand the problem though.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Using Octrees
PostPosted: Sun Feb 16, 2014 12:02 am 

Joined: Thu Feb 06, 2014 3:02 am
Posts: 14
David Williams wrote:
Hansiec wrote:
In theory, I assume volumes aren't thread-safe because of the possibility of it being modified while another thread is accessing it, but if I were to make a check to see if it's in use, and only do the operations if it's not being modified/read would this make it thread safe?


In the case of SimpleVolume I think this should make it thread-safe, though I think you can get away with simultaneous reads anyway. In the case of LargeVolume it's a little more complex, as accessing a voxel can potentially cause another voxel to get paged out of memory. This is the first thing I'd like to address in a new system.

It does need some more research before I fully understand the problem though.


Alright, thanks for the heads up!


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

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