diff options
author | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-11-30 15:22:03 -0500 |
---|---|---|
committer | Nyx (Neal Orman) <nyx@lindenlab.com> | 2009-11-30 15:22:03 -0500 |
commit | 467125856922a715b3a3b3d02ed108240b2ce95d (patch) | |
tree | 752638a453344f31b20a78fd9613f6e75f6b68ba /indra/newview/lltexlayer.cpp | |
parent | 43d52671c8c71af188456c200baba7c3bc8d4799 (diff) |
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
Diffstat (limited to 'indra/newview/lltexlayer.cpp')
-rw-r--r-- | indra/newview/lltexlayer.cpp | 47 |
1 files changed, 31 insertions, 16 deletions
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; } |