Skip to main content
GameDev.net gamedev.net
🔒 Locked

Culling with Octrees

Started by Charles Thomas Nov 4, 2004 at 10:19 PM 1 replies 650+ views
Original Post
Charles Thomas
Charles Thomas
Hi, I've had this nagging problem with my octree and culling. I've tried culling in camera space and in projection space and the results I get are the same . . . I cull portions, but the wrong ones. I use a recursive function to basically traverse through the octree. At the beginning of this function I compute the position in ( camera space or projection ) and cull it. So, my question is how should i cull things with the octree and what calulations are made?
Zakwayda
Zakwayda
Simple overview:

1. Extract the planes of your frustum from your view*projection matrix. The results should be in world space. This is the hardest step - look here or online for 'extracting frustum planes', or check out GPG4 for a good article.

2. Test the bounding box of the octree root node against the frustum.

3. If completely outside the frustum, you're done.

4. If completely inside the frustum, trivially traverse all children of the node and mark their contents as visible.

5. If partially inside the frustum, rinse and repeat: goto number 2 for each of the node's eight children.

Let me know if you need any clarification.
Charles Thomas
Charles Thomas
Excellent, thanks for the help. It has cleared up some of the mess I've been considering.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.