Results 1 to 6 of 6

Thread: Stencil Buffer values

  1. #1
    Member Newbie
    Join Date
    Jan 2001
    Posts
    48

    Stencil Buffer values

    If the stencil test passes in the following stencil function what value is written to the stencil buffer 4 or 0?

    Code :
    glStencilFunc(GL_NOTEQUAL,0x4,0x1);
    glStencilOp(GL_KEEP,GL_REPLACE,GL_REPLACE);
    4 right? because the mask just affects the comparison between the present stencil buffer value.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Apr 2002
    Location
    St. Louis, MO USA
    Posts
    177

    Re: Stencil Buffer values

    The value is 4 because you have your stencil op for when the stencil test passes set to GL_REPLACE. GL_REPLACE simply replaces the current value in the stencil buffer with the reference value.

  3. #3
    Member Newbie
    Join Date
    Jan 2001
    Posts
    48

    Re: Stencil Buffer values

    Thanks, ioquan.

    I have another question that I posted in the advanced forum and no one has given me feedback, perhaps you could.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Apr 2002
    Location
    St. Louis, MO USA
    Posts
    177

    Re: Stencil Buffer values

    I saw your question there but wasnt sure what you were trying to ask. Can you restate/simplify your question?

    edit: I looked at the link to the .txt file. That is using the two sided stencil extension. Is there a reason why you want to use the two sided stencil extension?

    [This message has been edited by ioquan (edited 10-21-2003).]

  5. #5
    Member Newbie
    Join Date
    Jan 2001
    Posts
    48

    Re: Stencil Buffer values

    I wasn't looking into using the two sided stencil extension. I was just trying to understand how to set the stencil values. So I followed the logic and it didn't work like it said it should work. Hope that makes sense.

    Basically, I found an error in the documentation and I wanted to share and make sure I was not wrong.

  6. #6
    Senior Member Regular Contributor
    Join Date
    Apr 2002
    Location
    St. Louis, MO USA
    Posts
    177

    Re: Stencil Buffer values

    No, you didnt find an error. You found documentation on the two sided stencil, and expected to operate the same way as normal one sided stenciling.

Similar Threads

  1. Stencil buffer values not good.
    By laurent7601 in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 01-18-2019, 03:35 PM
  2. Incorrect values written in stencil buffer
    By sayan751 in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 06-21-2016, 11:14 PM
  3. Replies: 1
    Last Post: 09-11-2013, 11:35 AM
  4. copy app generated stencil data to stencil buffer
    By guilder in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 12-23-2010, 06:46 PM
  5. Converting World Values to Depth Buffer Values
    By Tokage in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-22-2004, 02:04 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