using bullet's BVH for culling?

tatsujin
Posts: 14
Joined: Fri Jul 18, 2008 8:06 pm

using bullet's BVH for culling?

Post by tatsujin »

Hi

I was thinking that maybe it would be possible to use the BVH that btBvhTriangleMeshShape builds for use with frustum culling in the rendering. If it is possible, a good idea, or not? I'm clear on how frustum culling is done, given that there are bounding boxes available.

My idea is to do culling of parts of a large mesh (think: terrain) using the BVH that bullet already builds (then I don't have to build my own partition stuff!). I'm of course aware that perhaps this will not be optimal for rendering, but is it possible? For example, how can I retrieve the bounding boxes and their contained triangles from the btQuantizedBvh? btQuantizedBvhNode doesn't seem to contain them... but I assume that the raycasting would need them during traversal so they must be in there somewhere... :)

Maybe related to this, but that sounds a bit more advanced and not applicable to my application.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: using bullet's BVH for culling?

Post by Erwin Coumans »

There is another dynamic AABB tree structure in Bullet that is more suitable for view frustum culling and occlusion culling, based on btDbvt. There is a demo in Bullet/Extras/CDTestFrameWork (based on btDbvtBroadphase) that let's you enable view frustum culling and occlusion culling.

See also this posting: http://bulletphysics.org/Bullet/phpBB3/ ... it=culling

Thanks,
Erwin
tatsujin
Posts: 14
Joined: Fri Jul 18, 2008 8:06 pm

Re: using bullet's BVH for culling?

Post by tatsujin »

Erwin Coumans wrote:There is another dynamic AABB tree structure in Bullet that is more suitable for view frustum culling and occlusion culling, based on btDbvt.
Thanks for the quick reply, and sorry for the slow reply :)

I didn't know about btDbvt. However, if I understand it correctly, it seems to do no mesh splitting on its own, and is "only" a structure of AABBs? My thought with the btBvh* mesh class(es) was that I wanted to take advantage of the actual mesh splitting/partitioning that takes place in there.

But btDbvt it seems to be a great piece of code to use in any similar setup.