Jump to content
  • Advertisement
Sign in to follow this  
ChristianFrantz

Octrees and how to use them

This topic is 2100 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

In a previous thread I made I was told to look at different data structures for my game. As far as I can tell, using octrees seems to be the way to go for me. 

 

http://www.xnawiki.com/index.php/Octree

Im using this as a base for my class. I know how they work and what their purpose is, I just don't know how to implement them into my game for things like occlusion culling and picking.

 

Right now I'm just going to have one octree for each 20x20x20 chunk. All my cubes will easily fit into one leaf so there's no hassle with more than one object in a leaf. 

When I want to do something like occlusion culling, how would I start? Do I just check the nodes in the tree against other nodes?

Share this post


Link to post
Share on other sites
Advertisement

I guess the basic idea of occlusion culling using trees is that if a tree node is occluded, any and all nodes descending from that node will be occluded as well.

 

So if you have an occluder that occludes lets say the root node of one of these 20^3 chunks, you can assume all objects inside are occluded too and be done with it.

 

 

Then you might in some cases want to traverse the scene close objects first, so you traverse the octree starting from the viewer (which seems somewhat complex)

So if you met a octree node that is fully solid when traversing, you would somehow be able to skip everything behind it, including other occluders, so you dont have to gather a huge list of occluders if there are many but only the occluders that are actually relevant and not covered by OTHER occluders.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!