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 3 of 3

Thread: waht's the "Stencil Test" Compare

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2011
    Posts
    8

    waht's the "Stencil Test" Compare

    void StencilFunc( enum func, int ref, uint mask )
    The stencil test conditionally discards a fragment based on the outcome of a comparison
    between the value in the stencil buffer at location (xw, yw) and a referencevalue.
    So i don't understand what's the value in the stencil buffer stand for. the value of RGBA?or something else?
    for depth test, it is clear that the value of Z coordinate is compared.

  2. #2
    Junior Member Newbie yoyonel's Avatar
    Join Date
    Sep 2010
    Location
    Paris
    Posts
    17

    Re: waht's the "Stencil Test" Compare

    Wikipedia is your friend:
    "A stencil buffer is an EXTRA BUFFER, in addition to the color buffer (pixel buffer) and depth buffer (z-buffering) ..."
    => http://en.wikipedia.org/wiki/Stencil_buffer
    Stencil buffer is a integer buffer, and it's use for binary test like: equal, less, more, notequal, etc ...
    "the stencil buffer is used to limit the area of rendering (stenciling)"

    YoYoOoOoOOoo

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

    Re: waht's the "Stencil Test" Compare

    No, the stencil buffer is another data buffer, similar to color (rgba) and depth, but separate.
    Typically 8 bits. Can be used to draw masks for example. Mandatory to use stencil shadows (less useful now).

    Maybe this page can help you understand better the stencil buffer and its possibilities :
    http://psysal.livejournal.com/67933.html


    EDIT: yoyonel was faster

Posting Permissions

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