Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 9 of 9

Thread: GL_EXT_packed_depth_stencil bug

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2008
    Posts
    4

    GL_EXT_packed_depth_stencil bug

    Hi!

    We use OpenGL and we really need stencil buffer in FBO. We tried to use

    GL_EXT_packed_depth_stencil

    and it works great on ATI! But we could not make it work on GeForce 6600 with latest drivers installed… Although OpenGL shows that this extension is supported.

    We thought that we might be missing something and used a sample from the extension specification (http://opengl.org/registry/specs/EXT...th_stencil.txt).
    Unfortunately that sample did not work also.

    We get the following error when we’re getting framebuffer status after creation:
    FRAMEBUFFER_UNSUPPORTED_EXT

    Also when we’re trying to create depth buffer and stencil buffer separately it also does not work.
    Looks like GL_EXT_packed_depth_stencil is the only way for us to get to stencil buffer on this videocard.

    Maybe someone had same situation?
    Has anyone successfully created stencil buffer in FBO on NVidia?

    If so, could you please post code that you use to create the framebuffer?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2004
    Posts
    990

    Re: GL_EXT_packed_depth_stencil bug

    glGenRenderbuffersEXT(1, &renderbuffer);
    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,renderbu ffer);
    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_STENCIL_NV, renderbuffer_width, renderbuffer_height);
    glBindRenderbufferEXT(GL_RENDERBUFFER_EXT,0);

    Seems to work just fine on my Quadro FX 1600M

  3. #3
    Member Regular Contributor
    Join Date
    Nov 2003
    Location
    Czech Republic
    Posts
    317

    Re: GL_EXT_packed_depth_stencil bug

    glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH24_STENCIL8_EXT, w, h);

    works fine even on GF6200, drivers 169.x

  4. #4
    Member Regular Contributor
    Join Date
    Nov 2003
    Location
    Czech Republic
    Posts
    317

    Re: GL_EXT_packed_depth_stencil bug

    Do not forget to bind it to both depth and stencil attachments:

    glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, rb);
    glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, rb);

  5. #5
    Junior Member Newbie
    Join Date
    Apr 2008
    Posts
    4

    Re: GL_EXT_packed_depth_stencil bug

    Thanks everyone. We won the battle for stencil creation, but now have strange results in using it/

    No matter how we fill the stencil - glClear() with specific value, or by drawing into it - same thing. If then we're using mask with NOT_EQUAL, LESS or GREATER - stencil test never passes.

    but if we set EQUAL, test passes always, no matter what is beeing compared to values in stencil.

    plus it works on ATI just fine.
    We might be missing something, or it might be really problems with drivers.

    Can anyone share really simple example of using stencil in FBO that can be compiled and run, to see if it really works here.

  6. #6
    Member Regular Contributor
    Join Date
    Apr 2007
    Location
    Fairfax, VA
    Posts
    252

    Re: GL_EXT_packed_depth_stencil bug

    When I was working on something related to this about a year ago, I found that packed_depth_stencil worked fine on a Quadro 4500 under XP, but produced garbage under Linux. Which OS are you on?

  7. #7
    Junior Member Newbie
    Join Date
    Apr 2008
    Posts
    4

    Re: GL_EXT_packed_depth_stencil bug

    Lindley,
    under XP. problems only with stencil. depth buffer works fine (using packed_depth_stencil ext)...

    if you have some working sample to share - I would appreciate it so much!

  8. #8
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,453

    Re: GL_EXT_packed_depth_stencil bug

    There were problems with the stencil mask reported on this forum when the windows' pixelformat has no stencil and the FBO has.
    The stencil mask was set to zero although it should be ~0 for all bits per default.
    Try explicitly setting the stencil mask once during init.

  9. #9
    Junior Member Newbie
    Join Date
    Apr 2008
    Posts
    4

    Re: GL_EXT_packed_depth_stencil bug

    Replic, thank you!

    the problem was really in that mask was set to 0 although specification says it won't.

    solution deffers little - we got to set the mask every time after FBO binding.

    Thanks again!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •