From 467125856922a715b3a3b3d02ed108240b2ce95d Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 30 Nov 2009 15:22:03 -0500 Subject: EXT-2974 alpha mask changes are not applied immediately Changed local compositing code for alpha masks to handle the case where we are generating a local composite of an alpha masked body part. See JIRA for repro information Code reviewed by Bigpapi --HG-- branch : avatar-pipeline --- indra/newview/lltexlayer.cpp | 47 +++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 16 deletions(-) (limited to 'indra/newview/lltexlayer.cpp') diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index a90f3ee181..8d3dcf8a99 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -689,24 +689,24 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height ) } } + LLGLSUIDefault gls_ui; + LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE); + gGL.setColorMask(true, true); + + // clear buffer area to ensure we don't pick up UI elements + { + gGL.flush(); + LLGLDisable no_alpha(GL_ALPHA_TEST); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.color4f( 0.f, 0.f, 0.f, 1.f ); + + gl_rect_2d_simple( width, height ); + + gGL.flush(); + } + if (mIsVisible) { - LLGLSUIDefault gls_ui; - LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE); - gGL.setColorMask(true, true); - - // clear buffer area to ensure we don't pick up UI elements - { - gGL.flush(); - LLGLDisable no_alpha(GL_ALPHA_TEST); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.color4f( 0.f, 0.f, 0.f, 1.f ); - - gl_rect_2d_simple( width, height ); - - gGL.flush(); - } - // composite color layers for( layer_list_t::iterator iter = mLayerList.begin(); iter != mLayerList.end(); iter++ ) { @@ -723,6 +723,21 @@ BOOL LLTexLayerSet::render( S32 x, S32 y, S32 width, S32 height ) stop_glerror(); } + else + { + gGL.flush(); + + gGL.setSceneBlendType(LLRender::BT_REPLACE); + LLGLDisable no_alpha(GL_ALPHA_TEST); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.color4f( 0.f, 0.f, 0.f, 0.f ); + + gl_rect_2d_simple( width, height ); + gGL.setSceneBlendType(LLRender::BT_ALPHA); + + gGL.flush(); + + } return success; } -- cgit v1.2.3