Results 1 to 6 of 6

Thread: Occlusion query with depth disabled pass

  1. #1
    Senior Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Occlusion query with depth disabled pass

    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.

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: Occlusion query with depth disabled pass

    from :
    http://www.opengl.org/sdk/docs/man/x...lDepthFunc.xml

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

  3. #3
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,294

    Re: Occlusion query with depth disabled pass

    I guess you need for your code to disable writing via the depth-mask and color-mask.

  4. #4
    Senior Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Re: Occlusion query with depth disabled pass

    i was looking in the wrong place. remembered, thanks alot.

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,042

    Re: Occlusion query with depth disabled pass

    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.
    GLIM - Immediate Mode Emulation for GL3

  6. #6
    Senior Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Re: Occlusion query with depth disabled pass

    thats valueable info Jan, thanks.

Similar Threads

  1. Replies: 2
    Last Post: 01-04-2016, 04:31 AM
  2. Replies: 1
    Last Post: 11-25-2015, 04:22 AM
  3. Stencil-op depth fail with depth testing disabled
    By AvCol in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 01-22-2011, 09:48 PM
  4. Occlusion query
    By V-man in forum OpenGL: Advanced Coding
    Replies: 18
    Last Post: 09-05-2006, 06:55 AM
  5. Occlusion query
    By Jan in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 04-26-2003, 08:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean