fix issues with glow

This commit is contained in:
rei-2
2025-08-12 16:30:20 -04:00
parent 573ce3ffbf
commit f246c3dbbe
+3 -1
View File
@@ -17,7 +17,6 @@ void CGlow::SetupBegin(IMatRenderContext* pRenderContext)
pRenderContext->ClearBuffers(false, false, false);
pRenderContext->SetStencilEnable(true);
pRenderContext->SetStencilCompareFunction(STENCILCOMPARISONFUNCTION_ALWAYS);
pRenderContext->SetStencilPassOperation(STENCILOPERATION_REPLACE);
pRenderContext->SetStencilFailOperation(STENCILOPERATION_KEEP);
@@ -28,6 +27,8 @@ void CGlow::SetupBegin(IMatRenderContext* pRenderContext)
}
void CGlow::SetupMid(IMatRenderContext* pRenderContext, int w, int h)
{
pRenderContext->SetStencilEnable(false);
pRenderContext->PushRenderTargetAndViewport();
pRenderContext->SetRenderTarget(m_pRenderBuffer1);
pRenderContext->Viewport(0, 0, w, h);
@@ -53,6 +54,7 @@ void CGlow::SetupEnd(Glow_t tGlow, IMatRenderContext* pRenderContext, int w, int
pRenderContext->PopRenderTargetAndViewport();
}
pRenderContext->SetStencilEnable(true);
pRenderContext->SetStencilCompareFunction(STENCILCOMPARISONFUNCTION_EQUAL);
pRenderContext->SetStencilPassOperation(STENCILOPERATION_KEEP);
pRenderContext->SetStencilFailOperation(STENCILOPERATION_KEEP);