Results 1 to 2 of 2

Thread: Stencil buffer usage

  1. #1

    Stencil buffer usage

    I am trying to learn the usage of stencil buffer. I try to create reflection of an object on a floor.
    But while i introduce the blue block the reflected object is not rendered.

    With no blue block I see a solid object, floor and the object which is supposed to be the reflection of the first object appears partly hidden behind the floor!!

    Below is the code. Please help me.

    glColorMask(0, 0, 0, 0);
    glStencilFunc(GL_ALWAYS, 1, 1);
    glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);

    glColorMask(1, 1, 1, 1);

    glStencilFunc(GL_EQUAL, 1, 1);
    glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);


  2. #2

    Re: Stencil buffer usage

    I could solve the problem !!

    I was viewing from a wrong angle so i could not see the reflected image.

    Thank you.

Similar Threads

  1. FBO with Stencil Buffer
    By JayFoxRox in forum OpenGL ES
    Replies: 0
    Last Post: 03-27-2009, 12:39 PM

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