diff --git a/src/gl/renderer/gl_renderstate.cpp b/src/gl/renderer/gl_renderstate.cpp index 9a3ea12e6..1bfed5fc6 100644 --- a/src/gl/renderer/gl_renderstate.cpp +++ b/src/gl/renderer/gl_renderstate.cpp @@ -440,7 +440,8 @@ void FGLRenderState::SetStencil(int offs, int op, int flags) glStencilOp(GL_KEEP, GL_KEEP, op2gl[op]); // this stage doesn't modify the stencil bool cmon = !(flags & SF_ColorMaskOff); - glColorMask(cmon, cmon, cmon, cmon); // don't write to the graphics buffer + bool cmalpha = cmon || (flags & SF_ColorMaskAlpha); + glColorMask(cmon, cmon, cmon, cmalpha); // don't write to the graphics buffer glDepthMask(!(flags & SF_DepthMaskOff)); } diff --git a/src/hwrenderer/scene/hw_portal.cpp b/src/hwrenderer/scene/hw_portal.cpp index dc2c8f4fb..6426e4213 100644 --- a/src/hwrenderer/scene/hw_portal.cpp +++ b/src/hwrenderer/scene/hw_portal.cpp @@ -301,7 +301,7 @@ void HWPortal::RemoveStencil(HWDrawInfo *di, FRenderState &state, bool usestenci state.EnableTexture(false); state.SetRenderStyle(STYLE_Source); - state.SetStencil(0, SOP_Keep, SF_ColorMaskOff); + state.SetStencil(0, SOP_Keep, SF_ColorMaskOff | SF_ColorMaskAlpha); // SSAO needs the alpha channel as a marker. if (needdepth) state.Clear(CT_Depth); state.SetDepthRange(0, 1); state.SetDepthFunc(DF_LEqual); @@ -946,8 +946,8 @@ void HWEEHorizonPortal::DrawContents(HWDrawInfo *di, FRenderState &state) { GLSkyInfo skyinfo; skyinfo.init(sector->sky, 0); - //GLSkyPortal sky(mState, &skyinfo, true); - //sky.DrawContents(di, state); + HWSkyPortal sky(screen->mSkyData, mState, &skyinfo, true); + sky.DrawContents(di, state); } if (sector->GetTexture(sector_t::ceiling) != skyflatnum) { diff --git a/src/hwrenderer/scene/hw_renderstate.h b/src/hwrenderer/scene/hw_renderstate.h index 52a053d46..530041391 100644 --- a/src/hwrenderer/scene/hw_renderstate.h +++ b/src/hwrenderer/scene/hw_renderstate.h @@ -57,6 +57,7 @@ enum EStencilFlags SF_AllOn = 0, SF_ColorMaskOff = 1, SF_DepthMaskOff = 2, + SF_ColorMaskAlpha = 4, // hack value for SSAO }; enum EStencilOp