Jump to content
  • Advertisement
Sign in to follow this  
Nextgenneo

Edge cases of a bounding box vs the view frustum

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

So I've implemented the basic view frustum culling algorithm but in my case the edge case of counting bounding boxes completely out of the frustum in is really effecting performance. Here's an image of what I am referring to: With the basic test the orange box is recorded as intersecting. Whats the fastest way to test for this case? Thanks

Share this post


Link to post
Share on other sites
Advertisement
I would imagine the simplest way would be to calculate a plane which is perpendicular to the far plane and where the far plane intersects with the frustum, and if the box is on the other side of that plane, cull it.

I hope you can understand what I wrote in that last paragraph without a diagram :-)

But I can't imagine there'd be all that many cases where this would actually have any effect... unless your bounding boxes are really huge, which kind of defeats the purpose (use an octree in that case).

Share this post


Link to post
Share on other sites
in more specific terms I am looking for exact frustum culling of an AABB.

and yeah, the above does make sense and I will implement this but is there a faster way?

Share this post


Link to post
Share on other sites
well I've researched it and I need to do a Separating Axis Test. I've figured out how to do this for an OBB and OBB but am not sure about a Frustum and an OBB.

Thanks

Share this post


Link to post
Share on other sites
It's outside the frustum when all of the points of the AABB are outside of the same side.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dave
It's outside the frustum when all of the points of the AABB are outside of the same side.


Unless the frustum is inside the AABB...

Share this post


Link to post
Share on other sites
Hi. Thanks for the replies and these are what I am currently implementing for my basic VF culling.

However let me show you the bug with some screenshots. I've captured what is drawn and the corresponding view frustum. The first screen shot is with the camera directly above the terrain and not rotated. The terrain is made up of concentric rings of increasing size (each ring made of 4 parts). You can see it correctly culls everything. I've also drawn the VF intercepts with the XZ Plane.



However when I rotate the camera as shown here the culling gets all messed up. I am fairly sure this is to do with the corner of the VF case and because my bounding box double in size every ring it causes lots of problems.



Any ideas?

Share this post


Link to post
Share on other sites
I think it might help if you also draw the bounding boxes. From what I can tell, the bounding box goes around a "ring" of the terrain, so the larger rings' bounding boxes actually go around the entire frustum, hence they're not being culled. That's what you would expect.

I think you need to break the terrain up differently -- i.e. not concentric rings, but instead into blocks. You could still use your current layout, but instead of one bounding box for the whole ring, you have 4 - one for each "side".

At least, that's assuming I'm understanding the situation here...

Share this post


Link to post
Share on other sites
Hi,

Sorry for not being clear enough. I've updated one of the screenshots to include some quickly drawn bounding boxes. So yeah, I split the rings into 4 rectangles.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!