PDA

View Full Version : Occlusion query with depth disabled pass



_NK47
10-08-2009, 02:43 AM
If i disable depth buffer test and render a quad with occlusion query i get 100% NON-occluded geometry. If i enable the depth buffer again i get other values depending on the depth buffer information before the quad which is occluded. Can't find in the specs if this is correct since the depth buffer is disabled and not set to GL_ALWAYS or any other value allowing to pass the depth test. Is the behavior correct that on disabled depth test the number of passed pixels is always 100%?
Note: Using standard OpenGL glBeginQuery, glEndQuery functions.

ZbuffeR
10-08-2009, 04:43 AM
from :
http://www.opengl.org/sdk/docs/man/xhtml/glDepthFunc.xml



If depth testing is disabled or if no depth buffer exists, it is as if the depth test always passes.

Ilian Dinev
10-08-2009, 05:03 AM
I guess you need for your code to disable writing via the depth-mask and color-mask.

_NK47
10-08-2009, 05:16 AM
i was looking in the wrong place. remembered, thanks alot.

Jan
10-08-2009, 05:23 AM
Note that on some cards (ATI mostly IIRC) the results from occlusion tests are not entirely correct / deterministic.

When i made some lens-flare effect, it worked perfectly on one card, and it was flickering all the time on another card. Looking at the values the occlusion query returned two very different values randomly each frame, although the occlusion didn't change.

Other people confirmed, that they had the same problem.

I don't know whether that still happens today, i only use occlusion queries for "all or nothing" tests these days.

Jan.

_NK47
10-08-2009, 08:56 AM
thats valueable info Jan, thanks.