Sign in to follow this  
Libe

OpenGL nv_occlusion_query for collisions

Recommended Posts

Hi, I read this paper about CULLIDE (http://gamma.cs.unc.edu/CULLIDE/) and I'd like to implement it in my little app, but I didn't understand a few points mainly about the use of opengl. Basically I didn't understand how can I check if for instance 2 bounding box collide or not, here an example: Free Image Hosting at www.ImageShack.us CULLIDE proceeds in two passes like this: The algorithm uses occlusion queries to test if an object is "fully visible" or not. To test if the object B is fully visible against A, CULLIDE renders A into the frame buffer. Next, it sets the depth function to GL GEQUAL and disables depth writes. The object B is rendered using an occlusion query(nv_occlusion_query). If the pixel pass count returned by occlusion query is zero, then the object B is fully visible against A. Then it goes the other way around meaning that it test if A is fully visible against B. CULLIDE states that A, B don't collide if A and B are fully visible. Now I'm not sure why CULLIDE inverts the depth function like that, my guess is because is the only way to check (given the # of pixel pass) if a primitive is fully visible. Also I'd like to know why it disables the depth write: my guess is that is to prevent the the depth to be updated while testing for the possible occlusion. Thank you Libe

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this