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);