some fixes with the stencil states and implemented stencil func/stencilop/stencilmask to renderstate

This commit is contained in:
Tleety
2016-02-04 11:13:26 +01:00
parent bc01e147c2
commit 379d211832
5 changed files with 93 additions and 17 deletions
+7 -1
View File
@@ -9,6 +9,10 @@ DrawFinalPassState::DrawFinalPassState(GLuint frameBuffer)
BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Enable(GL_DEPTH_TEST);
Enable(GL_CULL_FACE);
Enable(GL_STENCIL_TEST);
StencilFunc(GL_NOTEQUAL, 1, 0xFF);
StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
StencilMask(0x00);
ClearColor(glm::vec4(0.f, 0.f, 0.f, 0.f));
}
@@ -21,7 +25,9 @@ DrawStencilState::DrawStencilState(GLuint frameBuffer)
{
BindFramebuffer(frameBuffer);
Enable(GL_STENCIL_TEST);
StencilFunc(GL_KEEP, GL_KEEP, GL_REPLACE);
StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE);
StencilFunc(GL_ALWAYS, 1, 0xFF);
StencilMask(0xFF);
Enable(GL_DEPTH_TEST);
ClearColor(glm::vec4(0.f));
}