From c686407731751ababecf01569fa02eb5ba62337d Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Thu, 13 Nov 2014 18:47:57 +0200 Subject: MAINT-4092 FIXED Prim faces with opaque diffuse maps, with material set to ALPHA_MODE_BLEND, do not render MAINT-4645 FIXED [viewer-lion] The build tool shows normal or specular map as 'none' when one exists --- indra/newview/llvovolume.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 35893a0354..f2199b5189 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2040,18 +2040,19 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) { - S32 res = 0; - - if (pMaterialParams && getTEImage(te) && 3 == getTEImage(te)->getComponents() && pMaterialParams->getDiffuseAlphaMode()) - { - LLViewerObject::setTEMaterialID(te, LLMaterialID::null); - res = LLViewerObject::setTEMaterialParams(te, NULL); - } - else + if(pMaterialParams) { - res = LLViewerObject::setTEMaterialParams(te, pMaterialParams); + LLViewerTexture* image = getTEImage(te); + LLGLenum image_format = image ? image->getPrimaryFormat() : GL_RGB; + LLMaterialPtr current_material = getTEMaterialParams(te); + const_cast(pMaterialParams)->setDiffuseAlphaMode( + current_material.isNull() ? (GL_RGB == image_format ? LLMaterial::DIFFUSE_ALPHA_MODE_NONE : LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) + : current_material->getDiffuseAlphaMode() + ); } + S32 res = LLViewerObject::setTEMaterialParams(te, pMaterialParams); + LL_DEBUGS("MaterialTEs") << "te " << (S32)te << " material " << ((pMaterialParams) ? pMaterialParams->asLLSD() : LLSD("null")) << " res " << res << ( LLSelectMgr::getInstance()->getSelection()->contains(const_cast(this), te) ? " selected" : " not selected" ) << LL_ENDL; -- cgit v1.2.3