I don’t understand exactly which z-coords use to compare with zmin and zmax of Depth Bounds.
In this example, I expect to obtain a blue point only in the screen, because the red one is rejected because its z-coord(0.9) is outside the range [0…0.5] of the bound test. But I see a black screen… :eek:
Someone knows what I do wrong? Is there any example of depth_bound_test_ext?¿
The depth bounds test compares the z value that’s already in the z buffer to the min and max depth bounds, not the z coordinate of the fragment being rendered. You see nothing because the z buffer is filled with 1.0, which is outside the depth bounds [0.0, 0.5] that you’re using.
I clean the depth buffer with value 1.0. Then I draw a red point with z-value on 0. Then, if I activate depth_bounds_test with the range [0…0.5] and I render a green point that intersects with the previous one, the only pixels that will be green are those that have the z-value of the red point?
My result is only a red point.
I expect that this test skips pixels that the current depth-buffer has a value outside the defined range.
Did you reverse the order of the red and green in your explanation? Couple questions here. First, what is your zNear and zFar value? And what is your projection mode? Both of these two settings affect the depth value of the point with z coord of 0. So the depth range (0.0, 0.5) might not cover the depth value of the first point. Second, I assume you enabled the depth testing and set the depthFunc to GL_LESS. If that was the case, it is very possible that the second point failed to pass the z-test such that you can’t it on the screen.