From 3237923e10a34d14ac4aac17400811cb1c7c3bdf Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 16 Aug 2018 00:31:39 +0100 Subject: MAINT-3699 new shaders supporting alpha blend/mask rigged content. Make shader loading debug logging of uniforms use ShaderUniform to make supression simpler. --- indra/newview/lldrawpoolavatar.cpp | 236 ++++++++++++++++++++++++++++++++----- 1 file changed, 209 insertions(+), 27 deletions(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index ef69990170..b318156cf8 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -60,6 +60,7 @@ static U32 sShaderLevel = 0; LLGLSLShader* LLDrawPoolAvatar::sVertexProgram = NULL; BOOL LLDrawPoolAvatar::sSkipOpaque = FALSE; BOOL LLDrawPoolAvatar::sSkipTransparent = FALSE; +S32 LLDrawPoolAvatar::sShadowPass = -1; S32 LLDrawPoolAvatar::sDiffuseChannel = 0; F32 LLDrawPoolAvatar::sMinimumAlpha = 0.2f; @@ -403,19 +404,33 @@ void LLDrawPoolAvatar::renderPostDeferred(S32 pass) S32 LLDrawPoolAvatar::getNumShadowPasses() { - return 2; + // avatars opaque, avatar alpha, avatar alpha mask, alpha attachments, alpha mask attachments, opaque attachments... + return NUM_SHADOW_PASSES; } void LLDrawPoolAvatar::beginShadowPass(S32 pass) { LL_RECORD_BLOCK_TIME(FTM_SHADOW_AVATAR); - if (pass == 0) + if (pass == SHADOW_PASS_AVATAR_OPAQUE) { sVertexProgram = &gDeferredAvatarShadowProgram; - //gGL.setAlphaRejectSettings(LLRender::CF_GREATER_EQUAL, 0.2f); + if ((sShaderLevel > 0)) // for hardware blending + { + sRenderingSkinned = TRUE; + sVertexProgram->bind(); + } + gGL.diffuseColor4f(1,1,1,1); + } + else if (pass == SHADOW_PASS_AVATAR_ALPHA_BLEND) + { + sVertexProgram = &gDeferredAvatarAlphaShadowProgram; + + // bind diffuse tex so we can reference the alpha channel... + sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + if ((sShaderLevel > 0)) // for hardware blending { sRenderingSkinned = TRUE; @@ -424,7 +439,52 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass) gGL.diffuseColor4f(1,1,1,1); } - else + else if (pass == SHADOW_PASS_AVATAR_ALPHA_MASK) + { + sVertexProgram = &gDeferredAvatarAlphaMaskShadowProgram; + + // bind diffuse tex so we can reference the alpha channel... + sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + + if ((sShaderLevel > 0)) // for hardware blending + { + sRenderingSkinned = TRUE; + sVertexProgram->bind(); + } + + gGL.diffuseColor4f(1,1,1,1); + } + else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_BLEND) + { + sVertexProgram = &gDeferredAttachmentAlphaShadowProgram; + + // bind diffuse tex so we can reference the alpha channel... + sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + + if ((sShaderLevel > 0)) // for hardware blending + { + sRenderingSkinned = TRUE; + sVertexProgram->bind(); + } + + gGL.diffuseColor4f(1,1,1,1); + } + else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_MASK) + { + sVertexProgram = &gDeferredAttachmentAlphaMaskShadowProgram; + + // bind diffuse tex so we can reference the alpha channel... + sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + + if ((sShaderLevel > 0)) // for hardware blending + { + sRenderingSkinned = TRUE; + sVertexProgram->bind(); + } + + gGL.diffuseColor4f(1,1,1,1); + } + else // SHADOW_PASS_ATTACHMENT_OPAQUE { sVertexProgram = &gDeferredAttachmentShadowProgram; sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); @@ -435,20 +495,19 @@ void LLDrawPoolAvatar::beginShadowPass(S32 pass) void LLDrawPoolAvatar::endShadowPass(S32 pass) { LL_RECORD_BLOCK_TIME(FTM_SHADOW_AVATAR); - if (pass == 0) - { - if (sShaderLevel > 0) - { - sRenderingSkinned = FALSE; - sVertexProgram->unbind(); - } - } - else + + if (pass == SHADOW_PASS_ATTACHMENT_OPAQUE) { LLVertexBuffer::unbind(); + } + + if (sShaderLevel > 0) + { sVertexProgram->unbind(); - sVertexProgram = NULL; } + sVertexProgram = NULL; + sRenderingSkinned = FALSE; + LLDrawPoolAvatar::sShadowPass = -1; } void LLDrawPoolAvatar::renderShadow(S32 pass) @@ -480,16 +539,68 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) return; } - if (pass == 0) + LLDrawPoolAvatar::sShadowPass = pass; + + if (pass == SHADOW_PASS_AVATAR_OPAQUE) { + LLDrawPoolAvatar::sSkipTransparent = true; avatarp->renderSkinned(); + LLDrawPoolAvatar::sSkipTransparent = false; } - else + else if (pass == SHADOW_PASS_AVATAR_ALPHA_BLEND) { - for (U32 i = 0; i < NUM_RIGGED_PASSES; ++i) - { - renderRigged(avatarp, i); - } + LLDrawPoolAvatar::sSkipOpaque = true; + avatarp->renderSkinned(); + LLDrawPoolAvatar::sSkipOpaque = false; + } + else if (pass == SHADOW_PASS_AVATAR_ALPHA_MASK) + { + LLDrawPoolAvatar::sSkipOpaque = true; + avatarp->renderSkinned(); + LLDrawPoolAvatar::sSkipOpaque = false; + } + else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_BLEND) // rigged alpha + { + LLDrawPoolAvatar::sSkipOpaque = true; + renderRigged(avatarp, RIGGED_MATERIAL_ALPHA); + renderRigged(avatarp, RIGGED_MATERIAL_ALPHA); + renderRigged(avatarp, RIGGED_MATERIAL_ALPHA_EMISSIVE); + renderRigged(avatarp, RIGGED_ALPHA); + renderRigged(avatarp, RIGGED_FULLBRIGHT_ALPHA); + renderRigged(avatarp, RIGGED_GLOW); + LLDrawPoolAvatar::sSkipOpaque = false; + } + else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_MASK) // rigged alpha mask + { + LLDrawPoolAvatar::sSkipOpaque = true; + renderRigged(avatarp, RIGGED_MATERIAL_ALPHA_MASK); + renderRigged(avatarp, RIGGED_NORMMAP_MASK); + renderRigged(avatarp, RIGGED_SPECMAP_MASK); + renderRigged(avatarp, RIGGED_NORMSPEC_MASK); + renderRigged(avatarp, RIGGED_GLOW); + LLDrawPoolAvatar::sSkipOpaque = false; + } + else // rigged opaque (SHADOW_PASS_ATTACHMENT_OPAQUE + { + LLDrawPoolAvatar::sSkipTransparent = true; + renderRigged(avatarp, RIGGED_MATERIAL); + renderRigged(avatarp, RIGGED_SPECMAP); + renderRigged(avatarp, RIGGED_SPECMAP_BLEND); + renderRigged(avatarp, RIGGED_SPECMAP_EMISSIVE); + renderRigged(avatarp, RIGGED_NORMMAP); + renderRigged(avatarp, RIGGED_NORMMAP_BLEND); + renderRigged(avatarp, RIGGED_NORMMAP_EMISSIVE); + renderRigged(avatarp, RIGGED_NORMSPEC); + renderRigged(avatarp, RIGGED_NORMSPEC_BLEND); + renderRigged(avatarp, RIGGED_NORMSPEC_EMISSIVE); + renderRigged(avatarp, RIGGED_SIMPLE); + renderRigged(avatarp, RIGGED_FULLBRIGHT); + renderRigged(avatarp, RIGGED_SHINY); + renderRigged(avatarp, RIGGED_FULLBRIGHT_SHINY); + renderRigged(avatarp, RIGGED_GLOW); + renderRigged(avatarp, RIGGED_DEFERRED_BUMP); + renderRigged(avatarp, RIGGED_DEFERRED_SIMPLE); + LLDrawPoolAvatar::sSkipTransparent = false; } } @@ -1737,8 +1848,81 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) LLVertexBuffer* buff = face->getVertexBuffer(); + const LLTextureEntry* tex_entry = face->getTextureEntry(); + LLMaterial* mat = tex_entry ? tex_entry->getMaterialParams().get() : nullptr; + + if (LLDrawPoolAvatar::sShadowPass >= 0) + { + bool is_alpha_blend = false; + bool is_alpha_mask = false; + + if (mat) + { + switch (LLMaterial::eDiffuseAlphaMode(mat->getDiffuseAlphaMode())) + { + case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: + { + is_alpha_mask = true; + } + break; + + case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND: + { + is_alpha_blend = true; + } + break; + + case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE: + case LLMaterial::DIFFUSE_ALPHA_MODE_DEFAULT: + case LLMaterial::DIFFUSE_ALPHA_MODE_NONE: + default: + break; + } + } + + if (tex_entry) + { + if (tex_entry->getAlpha() <= 0.99f) + { + is_alpha_blend = true; + } + } + + 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)) + { + return; + } + + // if this is alpha blend content and we're doing opaques or a non-alpha-blend shadow pass... + if (is_alpha_blend && (LLDrawPoolAvatar::sSkipTransparent || LLDrawPoolAvatar::sShadowPass != SHADOW_PASS_ATTACHMENT_ALPHA_BLEND)) + { + return; + } + + // if this is opaque content and we're skipping opaques... + if (!is_alpha_mask && !is_alpha_blend && LLDrawPoolAvatar::sSkipOpaque) + { + return; + } + } + if (buff) - { + { if (sShaderLevel > 0) { // upload matrix palette to shader @@ -1794,9 +1978,6 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) gGL.diffuseColor4f(0,0,0,face->getTextureEntry()->getGlow()); }*/ - const LLTextureEntry* te = face->getTextureEntry(); - LLMaterial* mat = te->getMaterialParams().get(); - if (mat) { //order is important here LLRender::DIFFUSE_MAP should be last, becouse it change @@ -1827,12 +2008,12 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) if (mat->getSpecularID().isNull()) { - env = te->getShiny()*0.25f; + env = tex_entry->getShiny()*0.25f; col.set(env,env,env,0); spec = env; } - BOOL fullbright = te->getFullbright(); + BOOL fullbright = tex_entry->getFullbright(); sVertexProgram->uniform1f(LLShaderMgr::EMISSIVE_BRIGHTNESS, fullbright ? 1.f : 0.f); sVertexProgram->uniform4f(LLShaderMgr::SPECULAR_COLOR, col.mV[0], col.mV[1], col.mV[2], spec); @@ -1840,7 +2021,8 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) { - sVertexProgram->setMinimumAlpha(mat->getAlphaMaskCutoff()/255.f); + F32 cutoff = mat->getAlphaMaskCutoff()/255.f; + sVertexProgram->setMinimumAlpha(cutoff); } else { -- cgit v1.2.3 From b066310231f4c5a5dc8a0d34a7b9679a32d99aed Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 21 Aug 2018 18:24:08 +0100 Subject: MAINT-9024 MAINT-9025 fix shadow render of materials objects to use alpha and don't draw MATERIAL_ALPHA content twice in shadow pass --- indra/newview/lldrawpoolavatar.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index b318156cf8..89e861bb51 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -563,11 +563,13 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) { LLDrawPoolAvatar::sSkipOpaque = true; renderRigged(avatarp, RIGGED_MATERIAL_ALPHA); - renderRigged(avatarp, RIGGED_MATERIAL_ALPHA); renderRigged(avatarp, RIGGED_MATERIAL_ALPHA_EMISSIVE); renderRigged(avatarp, RIGGED_ALPHA); renderRigged(avatarp, RIGGED_FULLBRIGHT_ALPHA); renderRigged(avatarp, RIGGED_GLOW); + renderRigged(avatarp, RIGGED_SPECMAP_BLEND); + renderRigged(avatarp, RIGGED_NORMMAP_BLEND); + renderRigged(avatarp, RIGGED_NORMSPEC_BLEND); LLDrawPoolAvatar::sSkipOpaque = false; } else if (pass == SHADOW_PASS_ATTACHMENT_ALPHA_MASK) // rigged alpha mask @@ -585,13 +587,10 @@ void LLDrawPoolAvatar::renderShadow(S32 pass) LLDrawPoolAvatar::sSkipTransparent = true; renderRigged(avatarp, RIGGED_MATERIAL); renderRigged(avatarp, RIGGED_SPECMAP); - renderRigged(avatarp, RIGGED_SPECMAP_BLEND); renderRigged(avatarp, RIGGED_SPECMAP_EMISSIVE); - renderRigged(avatarp, RIGGED_NORMMAP); - renderRigged(avatarp, RIGGED_NORMMAP_BLEND); + renderRigged(avatarp, RIGGED_NORMMAP); renderRigged(avatarp, RIGGED_NORMMAP_EMISSIVE); renderRigged(avatarp, RIGGED_NORMSPEC); - renderRigged(avatarp, RIGGED_NORMSPEC_BLEND); renderRigged(avatarp, RIGGED_NORMSPEC_EMISSIVE); renderRigged(avatarp, RIGGED_SIMPLE); renderRigged(avatarp, RIGGED_FULLBRIGHT); @@ -1804,6 +1803,10 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) for (U32 i = 0; i < mRiggedFace[type].size(); ++i) { LLFace* face = mRiggedFace[type][i]; + + S32 offset = face->getIndicesStart(); + U32 count = face->getIndicesCount(); + LLDrawable* drawable = face->getDrawable(); if (!drawable) { @@ -1969,9 +1972,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) } U16 start = face->getGeomStart(); - U16 end = start + face->getGeomCount()-1; - S32 offset = face->getIndicesStart(); - U32 count = face->getIndicesCount(); + U16 end = start + face->getGeomCount()-1; /*if (glow) { -- cgit v1.2.3 From 50f6504d75f30efb2955b82d7ec2b5283c10f402 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Sat, 25 Aug 2018 00:26:26 +0100 Subject: MAINT-9046 honor alpha mode none even when texture has alpha channel when checking state in avatar attachment shadow passes --- indra/newview/lldrawpoolavatar.cpp | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') 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)) { -- cgit v1.2.3 From 53abfe53bd91e7d81ffbf037b807e2e8b226d2f2 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 18 Sep 2018 17:53:35 +0100 Subject: SL-1835 Make attachmentAlphaMaskShadow frag shader ignore vert alpha which can be incorrect. Make discard test in attachmentAlphaMaskShadow match other shadow shaders more closely. Fix highlightF shader compile error. --- indra/newview/lldrawpoolavatar.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index a9df63debd..a2308b2529 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1807,6 +1807,9 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) S32 offset = face->getIndicesStart(); U32 count = face->getIndicesCount(); + U16 start = face->getGeomStart(); + U16 end = start + face->getGeomCount()-1; + LLDrawable* drawable = face->getDrawable(); if (!drawable) { @@ -1862,15 +1865,10 @@ 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 (mat) @@ -1894,6 +1892,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) case LLMaterial::DIFFUSE_ALPHA_MODE_NONE: default: is_alpha_blend = false; + is_alpha_mask = false; break; } } @@ -1906,6 +1905,15 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) } } + if (tex) + { + LLGLenum image_format = tex->getPrimaryFormat(); + 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)) { @@ -1972,9 +1980,6 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) data_mask &= ~LLVertexBuffer::MAP_WEIGHT4; } - U16 start = face->getGeomStart(); - U16 end = start + face->getGeomCount()-1; - /*if (glow) { gGL.diffuseColor4f(0,0,0,face->getTextureEntry()->getGlow()); -- cgit v1.2.3 From 00fe3e06e2d4a43b8dc9fd03ae247b392bca5446 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 24 Sep 2018 16:57:31 +0100 Subject: SL-6613 more fine-tuning of the logic around rigged alpha shadows to avoid issues when a diffuse texture with alpha is used with non-blended material diffuse alpha modes --- indra/newview/lldrawpoolavatar.cpp | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'indra/newview/lldrawpoolavatar.cpp') diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index a2308b2529..a1003aa864 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1871,19 +1871,38 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) } } + if (tex) + { + LLGLenum image_format = tex->getPrimaryFormat(); + if (!is_alpha_mask && (image_format == GL_RGBA || image_format == GL_ALPHA)) + { + is_alpha_blend = true; + } + } + + if (tex_entry) + { + if (tex_entry->getAlpha() <= 0.99f) + { + is_alpha_blend = true; + } + } + if (mat) { switch (LLMaterial::eDiffuseAlphaMode(mat->getDiffuseAlphaMode())) { case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: { - is_alpha_mask = true; + is_alpha_mask = true; + is_alpha_blend = false; } break; case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND: { is_alpha_blend = true; + is_alpha_mask = false; } break; @@ -1897,23 +1916,6 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) } } - if (tex_entry) - { - if (tex_entry->getAlpha() <= 0.99f) - { - is_alpha_blend = true; - } - } - - if (tex) - { - LLGLenum image_format = tex->getPrimaryFormat(); - 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)) { -- cgit v1.2.3