Jump to content
  • Advertisement
Sign in to follow this  
efoun

OpenGL Depth bound test

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

I would like to ask how use opengl extension GL_DEPTH_BOUNDS_TEST_EXT. I read documentation about this extension and a I try this:
glDepthBoundsEXT(0.3, 0.7);
glEnable(GL.GL_DEPTH_BOUNDS_TEST_EXT);
		
glBegin(GL.GL_QUADS);
	glColor4f(0.0f, 1.0f, 0.0f, 0.4f); 
	glVertex3f( -1.0f, -1.0f, -1.0f);
	glVertex3f(  1.0f, -1.0f, -1.0f);
	glVertex3f(  1.0f,  1.0f, -100.0f);
	glVertex3f( -1.0f,  1.0f, -100.0f);
glEnd();

with projection matrix:
gluPerspective(45.0f, h, 1.0, 100.0);

where h = widht/height. If I don´t used this extension, it render this: If I used extension, it render this: but I expect something like this: (I think that the extension cuts 2 part of polygon, first one is front of the polygon part with depth smaller then 0.3 and second one is back of polygon with depth bigger then 0.7) that is why I ask whether I used this extension correctly or this extension has other correct usage.

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!