Using AABB info to sort geometry relative to the camera

rraallvv
Posts: 30
Joined: Thu Feb 09, 2012 2:39 am

Using AABB info to sort geometry relative to the camera

Post by rraallvv »

I have almost any object in my scene attached to a btCollisionObject, even those that are just graphics have a btEmptyShape.

I need to sort the geometry from the far back up to the camera to render transparent objects right.

So, I would like to use the AABB information that is already in the bullet simulation to sort those objects.

Any suggestion on how to do it is welcome.

Any comment is appreciated.
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: Using AABB info to sort geometry relative to the camera

Post by Flix »

AFAIR (but I'm not 100% sure about it), the function of the btDbvt that can used to perform occlusion culling keeps the object ordered.
However, if you're not using occlusion culling in the first place, I believe that it will be faster for you to sort the objects manually (after performing frustum culling).
More of this here http://www.bulletphysics.org/Bullet/php ... f=9&t=7575.
rraallvv
Posts: 30
Joined: Thu Feb 09, 2012 2:39 am

Re: Using AABB info to sort geometry relative to the camera

Post by rraallvv »

Flix wrote:AFAIR (but I'm not 100% sure about it), the function of the btDbvt that can used to perform occlusion culling keeps the object ordered.
However, if you're not using occlusion culling in the first place, I believe that it will be faster for you to sort the objects manually (after performing frustum culling).
More of this here http://www.bulletphysics.org/Bullet/php ... f=9&t=7575.
Very useful, I'll take a look at your demo, and the implementations in the issue posted in github.

Regards.