summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolalpha.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2022-05-05 12:59:50 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2022-05-05 14:06:30 +0300
commit10e8ea5ff884b3466587f078c1b62204605eff06 (patch)
tree6db3f240f9ec354ae5ed36bb87410df4b889e828 /indra/newview/lldrawpoolalpha.cpp
parent9e352924207447ab294f9581cfc349e17fdd6f6b (diff)
parentf3add82a4c7f34bfff285302c34d952902451cad (diff)
Merge branch 'DRTVWR-546' into DRTVWR-539
Diffstat (limited to 'indra/newview/lldrawpoolalpha.cpp')
-rw-r--r--indra/newview/lldrawpoolalpha.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index eebd89f77f..e674707c01 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -717,6 +717,16 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)
LLGLEnableFunc stencil_test(GL_STENCIL_TEST, params.mSelected, &LLGLCommonFunc::selected_stencil_test);
gGL.blendFunc((LLRender::eBlendFactor) params.mBlendFuncSrc, (LLRender::eBlendFactor) params.mBlendFuncDst, mAlphaSFactor, mAlphaDFactor);
+
+ bool reset_minimum_alpha = false;
+ if (!LLPipeline::sImpostorRender &&
+ params.mBlendFuncDst != LLRender::BF_SOURCE_ALPHA &&
+ params.mBlendFuncSrc != LLRender::BF_SOURCE_ALPHA)
+ { // this draw call has a custom blend function that may require rendering of "invisible" fragments
+ current_shader->setMinimumAlpha(0.f);
+ reset_minimum_alpha = true;
+ }
+
U32 drawMask = mask;
if (params.mFullbright)
{
@@ -729,6 +739,11 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)
params.mVertexBuffer->setBufferFast(drawMask);
params.mVertexBuffer->drawRangeFast(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset);
+
+ if (reset_minimum_alpha)
+ {
+ current_shader->setMinimumAlpha(MINIMUM_ALPHA);
+ }
}
// If this alpha mesh has glow, then draw it a second time to add the destination-alpha (=glow). Interleaving these state-changing calls is expensive, but glow must be drawn Z-sorted with alpha.