- move stencil recursion counter to render state.

This commit is contained in:
Christoph Oelckers 2018-10-21 10:58:11 +02:00
commit acad8315d0
5 changed files with 30 additions and 19 deletions

View file

@ -240,8 +240,7 @@ void FGLRenderState::Apply()
if (mStencil.mChanged)
{
int recursion = GLRenderer->mPortalState.GetRecursion();
glStencilFunc(GL_EQUAL, recursion + mStencil.mOffsVal, ~0); // draw sky into stencil
glStencilFunc(GL_EQUAL, mStencil.mBaseVal + mStencil.mOffsVal, ~0); // draw sky into stencil
glStencilOp(GL_KEEP, GL_KEEP, op2gl[mStencil.mOperation]); // this stage doesn't modify the stencil
bool cmon = !(mStencil.mFlags & SF_ColorMaskOff);