Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

Using Octrees
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=571
Page 1 of 1

Author:  Hansiec [ Fri Feb 07, 2014 4:37 am ]
Post subject:  Using Octrees

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

Author:  David Williams [ Mon Feb 10, 2014 9:22 am ]
Post subject:  Re: Using Octrees

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.

Author:  Hansiec [ Tue Feb 11, 2014 12:13 am ]
Post subject:  Re: Using Octrees

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.

Author:  David Williams [ Tue Feb 11, 2014 8:36 pm ]
Post subject:  Re: Using Octrees

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 ;-)

Author:  Hansiec [ Wed Feb 12, 2014 12:09 am ]
Post subject:  Re: Using Octrees

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.

Author:  David Williams [ Thu Feb 13, 2014 8:39 pm ]
Post subject:  Re: Using Octrees

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...

Author:  Hansiec [ Fri Feb 14, 2014 12:56 am ]
Post subject:  Re: Using Octrees

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?

Author:  David Williams [ Sat Feb 15, 2014 10:04 pm ]
Post subject:  Re: Using Octrees

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.

Author:  Hansiec [ Sun Feb 16, 2014 12:02 am ]
Post subject:  Re: Using Octrees

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!

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/