diff options
author | Graham Linden <graham@lindenlab.com> | 2018-08-25 00:26:26 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-08-25 00:26:26 +0100 |
commit | 50f6504d75f30efb2955b82d7ec2b5283c10f402 (patch) | |
tree | 9f97a0aad470334ff5728e9ae9e6251caa27aea9 | |
parent | a50e4c3aeed7bcf0f75e26bc4f0671f9d7ff48cf (diff) |
MAINT-9046 honor alpha mode none even when texture has alpha channel when checking state in avatar attachment shadow passes
-rw-r--r-- | indra/newview/lldrawpoolavatar.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 89e861bb51..a9df63debd 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1859,6 +1859,20 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) bool is_alpha_blend = false; bool is_alpha_mask = false; + LLViewerTexture* tex = face->getTexture(LLRender::DIFFUSE_MAP); + if (tex) + { + LLGLenum image_format = tex->getPrimaryFormat(); + if (tex->getIsAlphaMask()) + { + is_alpha_mask = true; + } + else if (!is_alpha_mask && (image_format == GL_RGBA || image_format == GL_ALPHA)) + { + is_alpha_blend = true; + } + } + if (mat) { switch (LLMaterial::eDiffuseAlphaMode(mat->getDiffuseAlphaMode())) @@ -1879,6 +1893,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) case LLMaterial::DIFFUSE_ALPHA_MODE_DEFAULT: case LLMaterial::DIFFUSE_ALPHA_MODE_NONE: default: + is_alpha_blend = false; break; } } @@ -1891,20 +1906,6 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) } } - LLViewerTexture* tex = face->getTexture(LLRender::DIFFUSE_MAP); - if (tex) - { - LLGLenum image_format = tex->getPrimaryFormat(); - if (tex->getIsAlphaMask()) - { - is_alpha_mask = true; - } - else if (!is_alpha_mask && (image_format == GL_RGBA || image_format == GL_ALPHA)) - { - is_alpha_blend = true; - } - } - // if this is alpha mask content and we're doing opaques or a non-alpha-mask shadow pass... if (is_alpha_mask && (LLDrawPoolAvatar::sSkipTransparent || LLDrawPoolAvatar::sShadowPass != SHADOW_PASS_ATTACHMENT_ALPHA_MASK)) { |