View Full Version : Occlusion query with depth disabled pass
10-08-2009, 03: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.
10-08-2009, 05:43 AM
If depth testing is disabled or if no depth buffer exists, it is as if the depth test always passes.
10-08-2009, 06:03 AM
I guess you need for your code to disable writing via the depth-mask and color-mask.
10-08-2009, 06:16 AM
i was looking in the wrong place. remembered, thanks alot.
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.
10-08-2009, 09:56 AM
thats valueable info Jan, thanks.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.