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.