I want to mask a rectangle shape with two different shapes
Shape 1 Which is in shape of a circle
Shape 2 Which is in shape of rectangle
This is the code for setting stencil mask for shape 1
glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP);
glStencilFunc(GL_NEVER, 1, 1); // never pass stencil test
glStencilMask(1);
This is the code for setting stencil mask for shape 2
glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP);
glStencilFunc(GL_NEVER, 4, 4); // never pass stencil test
glStencilMask(4);
Now i can mask the geometry shape with a value of 5 and the shape will only be drawn where both the masks were drawn
glStencilFunc(GL_EQUAL, 5, 5);
break;
But how do i draw the geometry where Shape 1 is GL_EQUAL and Shape 2 is GL_NOTEQUAL
Like the image below