Jump to content
  • Advertisement
Sign in to follow this  

EXT_depth_bounds_test

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

Hi, Just want to know how does EXT_depth_bounds_test work. A small example would be highgly appreciated. glDepthBoundsEXT (0.00 , 1.00 ); Will the above command clamp the znear and zfar planes to the given range ([0,1] in this case) OR it will enable testing of the depth value of the incoming fragment between the given range. I assumed the latter case and I implemented void display(void) { glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity (); glMultMatrixf (state->rot_matrix); glEnable(GL_EXT_depth_bounds_test); glDepthBoundsEXT ( 0.2 , 0.3 ) ; drawscene(); glDisable(GL_EXT_depth_bounds_test); glutSwapBuffers(); glutPostRedisplay(); } I was expecting the portion of the drawscene to be clipped, but it didnt happen. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
The depth bounds test is an entirely new test. Normal depth testing compares the new fragment's depth against the depth stored in the depth buffer. The depth bounds test compares the depth already in the buffer against the minimum and maximum, and discards the fragment if they're outside that range. It's meant to be used to optimize shadow volumes in much the same way as you can use the scissor test to do so.

Share this post


Link to post
Share on other sites
And the correct enum for the cap parameter of glEnable/glDisable is GL_DEPTH_BOUNDS_TEST_EXT. GL_EXT_depth_bounds_test is just the name of the extension.

Share this post


Link to post
Share on other sites
Thanks a lot.

Now the code works. But I have one more doubt.

If I give the range [0,1]

glDepthBoundsEXT ( 0.0 , 1.0 ) ;

it works.

But if I give anything else like glDepthBoundsEXT ( 0.0 , 0.99 ) ; it doesnt show me anything.

I dont understand what could be reason for that.

Thanks

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!