PDA

View Full Version : depth_bounds_test & depth_test



Wayne
12-20-2004, 12:00 PM
I think the most important feature of GL_EXT_depth_bounds_test is that it has NO dependency on the fragment's window-space depth value. Thus, you can modify the depth value in your fragment program. Moreover, depth_bounds_test and depth_test are independantly. It is said that you can disable depth test and enable depth_bounds_test only.

I implemented a program to test this feature. I found that they do work independantly. But the problem is that when the depth test is disabled, the depth buffer is not updated anymore, although the depth value is modified in the fragment program. Should the depth buffer also be updated when only depth_bounds_test is enabled?

V-man
12-20-2004, 06:29 PM
>>>Thus, you can modify the depth value in your fragment program<<<

You can modify the depth values in your fp without this extension.
The purpose of this extension is to help with stencil shadows, not to change depth values.

You should probably post what you did here if it isn't working.

The spec explain how this ext works. No need to guess.

cass
12-21-2004, 06:37 AM
If you want the depth buffer to be updated, you need to enable the depth test and set the DepthFunc to ALWAYS.

Wayne
12-21-2004, 06:37 PM
If the DepthFunc is set to GL_ALWAYS, the depth_bounds_test does not work anymore.

cass
12-21-2004, 09:41 PM
The depth bounds test still works. It's orthogonal to the depth test. Whether the depth bounds test
passes or fails will change because you're changing the values in the depth buffer when you render with DepthFunc==ALWAYS.

Can you provide more specifics about the problem you're seeing?