diff options
| author | Dave Parks <davep@lindenlab.com> | 2022-05-16 12:26:17 -0500 |
|---|---|---|
| committer | Dave Parks <davep@lindenlab.com> | 2022-05-16 12:26:17 -0500 |
| commit | b2141e94465998d13ab4b5d894b0edcdad0e8216 (patch) | |
| tree | cba0541baffa141e9e3e2aecd16ce8cd9457c88c /indra/newview/lldrawpoolalpha.cpp | |
| parent | 3400e5fd302c0d9dea6386c4d5bf38876f2cc287 (diff) | |
| parent | 63095005578007345d9916ebc6855246cdb08c7c (diff) | |
Merge remote-tracking branch 'remotes/origin/DRTVWR-546' into DRTVWR-559
Diffstat (limited to 'indra/newview/lldrawpoolalpha.cpp')
| -rw-r--r-- | indra/newview/lldrawpoolalpha.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 47330debd3..a43b30465b 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -719,6 +719,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) { @@ -731,6 +741,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. |
