# Physics Simulation Forum

 All times are UTC

 Page 1 of 1 [ 3 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: Bullet for occlusion cullingPosted: Mon May 07, 2007 4:54 pm

Joined: Mon Mar 12, 2007 9:55 pm
Posts: 22
Has anybody implemented occlusion culling using Bullet?

The type of occlusion culling I would like to do is pretty much the exact opposite of viewport frustum culling, where the occlusion frustum removes from the draw list each object that is completely contained in a frustum that represents the occluder. This is equivalent to keeping only objects that intersect at all with the area not contained in the frustum. This region is by definition concave, since it is all space except for the frustum. Since the shape is concave, passing it to GJK wouldn't work.

This is easy to implement as a series of plane tests. You could pass the 5 planes to GJK, but how well does GJK handle planes, since they are infinite, and what would you use as the supporting vertex? I could imagine using a large but finite quad as each plane but I can also imagine several issues with that approach.

Another idea I had is to use the batchedUnitVectorGetSupportingVertexWithoutMargin function, passing in each plane's normal, and then do standard plane tests against the results. This way, I could automatically support each shape that already works with GJK and not have to create custom code for each shape.

Any other ideas?

Top

 Post subject: Re: Bullet for occlusion cullingPosted: Wed May 16, 2007 2:33 pm

Joined: Sun Jun 26, 2005 6:43 pm
Posts: 3825
Location: California, USA
slithEToves wrote:
Has anybody implemented occlusion culling using Bullet?

Not sure, but it is an interesting idea, and definately possible to use collision data for occlusion culling.
Quote:
This is easy to implement as a series of plane tests. You could pass the 5 planes to GJK, but how well does GJK handle planes, since they are infinite, and what would you use as the supporting vertex? I could imagine using a large but finite quad as each plane but I can also imagine several issues with that approach.

Bullet implements infinite plane, by projecting the AABB of the other (moving) object onto the plane and creating (temp) triangles on-the-fly.
But I prefer your suggestion to use the 'support function':
Quote:
Another idea I had is to use the batchedUnitVectorGetSupportingVertexWithoutMargin function, passing in each plane's normal, and then do standard plane tests against the results. This way, I could automatically support each shape that already works with GJK and not have to create custom code for each shape.

This is an excellent idea, and it should work very well. This should give you a test wether objects are completely overlapping the convex (truncated) frustum pyramid.
Quote:
Any other ideas?

Perhaps another way would be to use AABB information (from sweep and prune, BVH/AABB tree and regular AABB's of objects) in combination with hardware occlusion query.
Sweep and prune allows you to perform front-to-back traversal, by extending the SAP ray cast (see links below) into a SAP box cast. When this box 'expands' properly during the traversal through sweep and prune space, you can conservatively approximate overlaps of any frustum pyramid too. This idea is probably too sketchy, so an implementation and whitepaper would be more suitable.

Thanks for sharing these ideas!
Erwin

First publication/mention of raycast through sweep and prune on comp.graphics.algorithms
Unfinished draft paper for ray/box cast through sweep and prune

Top

 Post subject: Posted: Wed May 16, 2007 8:18 pm

Joined: Mon Mar 12, 2007 9:55 pm
Posts: 22
Thanks for the additional info on the Sweep/Prune method. I probably won't be able code the occlusion culling for a few weeks due to other priorities, so I won't have any results to report until then.

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 3 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 11 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ BULLET PHYSICS LIBRARY USERS    General Bullet Physics Support and Feedback    Release Announcements    Applications, Games, Demos or Movies using Bullet PHYSICS AUTHORING TOOLS, SERIALIZATION AND STANDARDS    Physics authoring tools, serialization, standards and related topics RESEARCH AND DEVELOPMENT IN COLLISION DETECTION & PHYSICS. Don't post Bullet support questions here!    Research and development discussion about Collision Detection and Physics Simulation    Links, Papers, Libraries, Demos, Movies, Comparisons       Non-technical forum and license/patent discussion    Career Opportunities