diff options
-rw-r--r-- | indra/llprimitive/llmaterial.cpp | 14 | ||||
-rw-r--r-- | indra/llprimitive/llmaterial.h | 11 | ||||
-rw-r--r-- | indra/newview/lldrawpoolavatar.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llface.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 29 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.h | 2 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 226 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 4 |
8 files changed, 194 insertions, 104 deletions
diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index e6d2790a5f..57ceb3e11b 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -106,16 +106,10 @@ LLMaterial::LLMaterial() , mEnvironmentIntensity(LLMaterial::DEFAULT_ENV_INTENSITY) , mDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) , mAlphaMaskCutoff(0) - , mIsDiffuseAlphaInvalid(false) - , mIsNormalInvalid(false) - , mIsSpecularInvalid(false) { } LLMaterial::LLMaterial(const LLSD& material_data) - : mIsDiffuseAlphaInvalid(false) - , mIsNormalInvalid(false) - , mIsSpecularInvalid(false) { fromLLSD(material_data); } @@ -205,17 +199,13 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode) { ret = getDiffuseAlphaMode(); } - if (mIsDiffuseAlphaInvalid && ret != DIFFUSE_ALPHA_MODE_DEFAULT) - { - ret = alpha_mode != DIFFUSE_ALPHA_MODE_NONE; - } llassert(ret < SHADER_COUNT); //next bit is whether or not specular map is present const U32 SPEC_BIT = 0x4; - if (getSpecularID().notNull() && !mIsSpecularInvalid) + if (getSpecularID().notNull()) { ret |= SPEC_BIT; } @@ -224,7 +214,7 @@ U32 LLMaterial::getShaderMask(U32 alpha_mode) //next bit is whether or not normal map is present const U32 NORM_BIT = 0x8; - if (getNormalID().notNull() && !mIsNormalInvalid) + if (getNormalID().notNull()) { ret |= NORM_BIT; } diff --git a/indra/llprimitive/llmaterial.h b/indra/llprimitive/llmaterial.h index 2f23a50973..9f52a3f6c1 100644 --- a/indra/llprimitive/llmaterial.h +++ b/indra/llprimitive/llmaterial.h @@ -120,13 +120,6 @@ public: void setAlphaMaskCutoff(U8 cutoff) { mAlphaMaskCutoff = cutoff; } bool isNull() const; - bool isDiffuseAlphaInvalid() const { return mIsDiffuseAlphaInvalid; } - void setDiffuseAlphaInvalid(bool is_invalid) { mIsDiffuseAlphaInvalid = is_invalid; } - bool isNormalInvalid() const { return mIsNormalInvalid; } - void setNormalInvalid(bool is_invalid) { mIsNormalInvalid = is_invalid; } - bool isSpecularInvalid() const { return mIsSpecularInvalid; } - void setSpecularInvalid(bool is_invalid) { mIsSpecularInvalid = is_invalid; } - static const LLMaterial null; bool operator == (const LLMaterial& rhs) const; @@ -154,10 +147,6 @@ protected: U8 mEnvironmentIntensity; U8 mDiffuseAlphaMode; U8 mAlphaMaskCutoff; - - bool mIsDiffuseAlphaInvalid; - bool mIsNormalInvalid; - bool mIsSpecularInvalid; }; typedef LLPointer<LLMaterial> LLMaterialPtr; diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 97dda072e7..8128790eb6 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -1818,7 +1818,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) F32 env = mat->getEnvironmentIntensity()/255.f; - if (mat->getSpecularID().isNull() || mat->isSpecularInvalid()) + if (mat->getSpecularID().isNull()) { env = te->getShiny()*0.25f; col.set(env,env,env,0); @@ -1831,7 +1831,7 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) sVertexProgram->uniform4f(LLShaderMgr::SPECULAR_COLOR, col.mV[0], col.mV[1], col.mV[2], spec); sVertexProgram->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, env); - if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && !mat->isDiffuseAlphaInvalid()) + if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) { sVertexProgram->setMinimumAlpha(mat->getAlphaMaskCutoff()/255.f); } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index d502e686c7..3d5e2d356e 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1084,7 +1084,7 @@ bool LLFace::canRenderAsMask() } LLMaterial* mat = te->getMaterialParams(); - if (mat && !mat->isDiffuseAlphaInvalid() && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) + if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) { return false; } @@ -1318,14 +1318,14 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (LLPipeline::sRenderDeferred) { //store shiny in alpha if we don't have a specular map - if (!mat || mat->getSpecularID().isNull() || mat->isSpecularInvalid()) + if (!mat || mat->getSpecularID().isNull()) { shiny_in_alpha = true; } } else { - if (!mat || mat->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_MASK || mat->isDiffuseAlphaInvalid()) + if (!mat || mat->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_MASK) { shiny_in_alpha = true; } @@ -1811,7 +1811,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, std::vector<LLVector2> bump_tc; - if (mat && !(mat->getNormalID().isNull() || mat->isNormalInvalid())) + if (mat && !mat->getNormalID().isNull()) { //writing out normal and specular texture coordinates, not bump offsets do_bump = false; } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 2762c7af82..93269db380 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -563,6 +563,7 @@ void LLInventoryPanel::modelChanged(U32 mask) { setSelection(item_id, FALSE); } + updateFolderLabel(model_item->getParentUUID()); } ////////////////////////////// @@ -574,6 +575,7 @@ void LLInventoryPanel::modelChanged(U32 mask) // Don't process the item if it is the root if (old_parent) { + LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(old_parent->getViewModelItem()); LLFolderViewFolder* new_parent = (LLFolderViewFolder*)getItemByID(model_item->getParentUUID()); // Item has been moved. if (old_parent != new_parent) @@ -591,6 +593,7 @@ void LLInventoryPanel::modelChanged(U32 mask) setSelection(item_id, FALSE); } } + updateFolderLabel(model_item->getParentUUID()); } else { @@ -602,6 +605,10 @@ void LLInventoryPanel::modelChanged(U32 mask) // doesn't include trash). Just remove the item's UI. view_item->destroyView(); } + if(viewmodel_folder) + { + updateFolderLabel(viewmodel_folder->getUUID()); + } old_parent->getViewModelItem()->dirtyDescendantsFilter(); } } @@ -619,6 +626,11 @@ void LLInventoryPanel::modelChanged(U32 mask) if(parent) { parent->getViewModelItem()->dirtyDescendantsFilter(); + LLFolderViewModelItemInventory* viewmodel_folder = static_cast<LLFolderViewModelItemInventory*>(parent->getViewModelItem()); + if(viewmodel_folder) + { + updateFolderLabel(viewmodel_folder->getUUID()); + } } } } @@ -1162,6 +1174,23 @@ void LLInventoryPanel::onSelectionChange(const std::deque<LLFolderViewItem*>& it } +void LLInventoryPanel::updateFolderLabel(const LLUUID& folder_id) +{ + if(folder_id != mPreviousSelectedFolder) return; + + LLFolderViewItem* folder_item = getItemByID(mPreviousSelectedFolder); + if(folder_item) + { + LLFolderBridge* bridge = (LLFolderBridge*)folder_item->getViewModelItem(); + if(bridge) + { + bridge->clearDisplayName(); + bridge->setShowDescendantsCount(true); + folder_item->refresh(); + } + } +} + void LLInventoryPanel::doCreate(const LLSD& userdata) { reset_inventory_filter(); diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 3829fb734d..12001f5a2b 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -209,6 +209,8 @@ public: bool attachObject(const LLSD& userdata); static void idle(void* user_data); + void updateFolderLabel(const LLUUID& folder_id); + // DEBUG ONLY: static void dumpSelectionInformation(void* user_data); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 206d34d7ea..f77b48ff80 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2052,81 +2052,134 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) } bool LLVOVolume::notifyAboutCreatingTexture(LLViewerTexture *texture) -{ - // Texture was created, process it and remove from wait list +{ //Ok, here we have confirmation about texture creation, check our wait-list + //and make changes, or return false std::pair<mmap_UUID_MAP_t::iterator, mmap_UUID_MAP_t::iterator> range = mWaitingTextureInfo.equal_range(texture->getID()); - if(range.first == range.second) return false; - bool needs_update = false; + typedef std::map<U8, LLMaterialPtr> map_te_material; + map_te_material new_material; for(mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it) { LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te); - if (cur_material.isNull()) - { - continue; - } - if (LLRender::DIFFUSE_MAP == range_it->second.map - && GL_RGBA != texture->getPrimaryFormat() - && cur_material->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_NONE - && cur_material->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_DEFAULT) - { - // We have non 32 bit texture with alpha, it is invalid + //here we just interesting in DIFFUSE_MAP only! + if(NULL != cur_material.get() && LLRender::DIFFUSE_MAP == range_it->second.map && GL_RGBA != texture->getPrimaryFormat()) + { //ok let's check the diffuse mode + switch(cur_material->getDiffuseAlphaMode()) + { + case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND: + case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE: + case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: + { //uups... we have non 32 bit texture with LLMaterial::DIFFUSE_ALPHA_MODE_* => LLMaterial::DIFFUSE_ALPHA_MODE_NONE + + LLMaterialPtr mat = NULL; + map_te_material::iterator it = new_material.find(range_it->second.te); + if(new_material.end() == it) { + mat = new LLMaterial(cur_material->asLLSD()); + new_material.insert(map_te_material::value_type(range_it->second.te, mat)); + } else { + mat = it->second; + } - cur_material->setDiffuseAlphaInvalid(true); - needs_update = true; - } + mat->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); + + } break; + } //switch + } //if + } //for + + //setup new materials + for(map_te_material::const_iterator it = new_material.begin(), end = new_material.end(); it != end; ++it) + { + LLMaterialMgr::getInstance()->put(getID(), it->first, *it->second); + LLViewerObject::setTEMaterialParams(it->first, it->second); } //clear wait-list mWaitingTextureInfo.erase(range.first, range.second); - return needs_update; + return 0 != new_material.size(); } bool LLVOVolume::notifyAboutMissingAsset(LLViewerTexture *texture) -{ - // Texture was marked as missing, process it and remove from wait list - +{ //Ok, here if we wait information about texture and it's missing + //then depending from the texture map (diffuse, normal, or specular) + //make changes in material and confirm it. If not return false. std::pair<mmap_UUID_MAP_t::iterator, mmap_UUID_MAP_t::iterator> range = mWaitingTextureInfo.equal_range(texture->getID()); if(range.first == range.second) return false; + + typedef std::map<U8, LLMaterialPtr> map_te_material; + map_te_material new_material; for(mmap_UUID_MAP_t::iterator range_it = range.first; range_it != range.second; ++range_it) { LLMaterialPtr cur_material = getTEMaterialParams(range_it->second.te); if (cur_material.isNull()) - { continue; - } - switch (range_it->second.map) + switch(range_it->second.map) { case LLRender::DIFFUSE_MAP: { - cur_material->setDiffuseAlphaInvalid(true); - break; - } + if(LLMaterial::DIFFUSE_ALPHA_MODE_NONE != cur_material->getDiffuseAlphaMode()) + { //missing texture + !LLMaterial::DIFFUSE_ALPHA_MODE_NONE => LLMaterial::DIFFUSE_ALPHA_MODE_NONE + LLMaterialPtr mat = NULL; + map_te_material::iterator it = new_material.find(range_it->second.te); + if(new_material.end() == it) { + mat = new LLMaterial(cur_material->asLLSD()); + new_material.insert(map_te_material::value_type(range_it->second.te, mat)); + } else { + mat = it->second; + } + + mat->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); + } + } break; case LLRender::NORMAL_MAP: - { - cur_material->setNormalInvalid(true); - break; - } + { //missing texture => reset material texture id + LLMaterialPtr mat = NULL; + map_te_material::iterator it = new_material.find(range_it->second.te); + if(new_material.end() == it) { + mat = new LLMaterial(cur_material->asLLSD()); + new_material.insert(map_te_material::value_type(range_it->second.te, mat)); + } else { + mat = it->second; + } + + mat->setNormalID(LLUUID::null); + } break; case LLRender::SPECULAR_MAP: - { - cur_material->setSpecularInvalid(true); - break; - } - default: + { //missing texture => reset material texture id + LLMaterialPtr mat = NULL; + map_te_material::iterator it = new_material.find(range_it->second.te); + if(new_material.end() == it) { + mat = new LLMaterial(cur_material->asLLSD()); + new_material.insert(map_te_material::value_type(range_it->second.te, mat)); + } else { + mat = it->second; + } + + mat->setSpecularID(LLUUID::null); + } break; + case LLRender::NUM_TEXTURE_CHANNELS: + //nothing to do, make compiler happy break; - } + } //switch + } //for + + //setup new materials + for(map_te_material::const_iterator it = new_material.begin(), end = new_material.end(); it != end; ++it) + { + LLMaterialMgr::getInstance()->put(getID(), it->first, *it->second); + LLViewerObject::setTEMaterialParams(it->first, it->second); } //clear wait-list mWaitingTextureInfo.erase(range.first, range.second); - return true; + return 0 != new_material.size(); } S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) @@ -2142,25 +2195,44 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa llassert(NULL != img_diffuse); + LLMaterialPtr new_material = NULL; + //diffuse if(NULL != img_diffuse) - { + { //guard if(0 == img_diffuse->getPrimaryFormat() && !img_diffuse->isMissingAsset()) - { - // Texture information is missing, wait for it + { //ok here we don't have information about texture, let's belief and leave material settings + //but we remember this case mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(img_diffuse->getID(), material_info(LLRender::DIFFUSE_MAP, te))); } else { + bool bSetDiffuseNone = false; if(img_diffuse->isMissingAsset()) { - pMaterial->setDiffuseAlphaInvalid(true); + bSetDiffuseNone = true; } - else if (GL_RGBA != img_diffuse->getPrimaryFormat() - && pMaterialParams->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_NONE - && pMaterialParams->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_DEFAULT) + else { - pMaterial->setDiffuseAlphaInvalid(true); + switch(pMaterialParams->getDiffuseAlphaMode()) + { + case LLMaterial::DIFFUSE_ALPHA_MODE_BLEND: + case LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE: + case LLMaterial::DIFFUSE_ALPHA_MODE_MASK: + { //all of them modes available only for 32 bit textures + if(GL_RGBA != img_diffuse->getPrimaryFormat()) + { + bSetDiffuseNone = true; + } + } break; + } + } //else + + + if(bSetDiffuseNone) + { //upps... we should substitute this material with LLMaterial::DIFFUSE_ALPHA_MODE_NONE + new_material = new LLMaterial(pMaterialParams->asLLSD()); + new_material->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE); } } } @@ -2170,11 +2242,14 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa { if(img_normal && img_normal->isMissingAsset() && img_normal->getID() == pMaterialParams->getNormalID()) { - pMaterial->setNormalInvalid(true); + if(!new_material) { + new_material = new LLMaterial(pMaterialParams->asLLSD()); + } + new_material->setNormalID(LLUUID::null); } else if(NULL == img_normal || 0 == img_normal->getPrimaryFormat()) - { - // Texture information is missing, wait for it + { //ok here we don't have information about texture, let's belief and leave material settings + //but we remember this case mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getNormalID(), material_info(LLRender::NORMAL_MAP,te))); } @@ -2186,14 +2261,22 @@ S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialPa { if(img_specular && img_specular->isMissingAsset() && img_specular->getID() == pMaterialParams->getSpecularID()) { - pMaterial->setSpecularInvalid(true); + if(!new_material) { + new_material = new LLMaterial(pMaterialParams->asLLSD()); + } + new_material->setSpecularID(LLUUID::null); } else if(NULL == img_specular || 0 == img_specular->getPrimaryFormat()) - { - // Texture information is missing, wait for it + { //ok here we don't have information about texture, let's belief and leave material settings + //but we remember this case mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getSpecularID(), material_info(LLRender::SPECULAR_MAP, te))); } } + + if(new_material) { + pMaterial = new_material; + LLMaterialMgr::getInstance()->put(getID(),te,*pMaterial); + } } S32 res = LLViewerObject::setTEMaterialParams(te, pMaterial); @@ -4485,7 +4568,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, } draw_info->mAlphaMaskCutoff = mat->getAlphaMaskCutoff() * (1.f / 255.f); - draw_info->mDiffuseAlphaMode = mat->isDiffuseAlphaInvalid() ? LLMaterial::DIFFUSE_ALPHA_MODE_NONE : mat->getDiffuseAlphaMode(); + draw_info->mDiffuseAlphaMode = mat->getDiffuseAlphaMode(); draw_info->mNormalMap = facep->getViewerObject()->getTENormalMap(facep->getTEOffset()); } @@ -4754,14 +4837,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } LLMaterial* mat = te->getMaterialParams().get(); - U8 alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE; - if (mat && !mat->isDiffuseAlphaInvalid()) - { - alpha_mode = mat->getDiffuseAlphaMode(); - } if (mat && LLPipeline::sRenderDeferred) { + U8 alpha_mode = mat->getDiffuseAlphaMode(); + bool is_alpha = type == LLDrawPool::POOL_ALPHA && (alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND || te->getColor().mV[3] < 0.999f); @@ -4781,10 +4861,11 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { bool fullbright = te->getFullbright(); bool is_alpha = type == LLDrawPool::POOL_ALPHA; - bool can_be_shiny = alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE || - alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE; + U8 mode = mat->getDiffuseAlphaMode(); + bool can_be_shiny = mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE || + mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE; - if (alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && te->getColor().mV[3] >= 0.999f) + if (mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && te->getColor().mV[3] >= 0.999f) { pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT : LLDrawPoolAvatar::RIGGED_SIMPLE); } @@ -4984,9 +5065,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (LLPipeline::sRenderDeferred && te->getMaterialParams().notNull() && !te->getMaterialID().isNull()) { LLMaterial* mat = te->getMaterialParams().get(); - if (mat->getNormalID().notNull() && !mat->isNormalInvalid()) + if (mat->getNormalID().notNull()) { - if (mat->getSpecularID().notNull() && !mat->isSpecularInvalid()) + if (mat->getSpecularID().notNull()) { //has normal and specular maps (needs texcoord1, texcoord2, and tangent) if (normspec_count < MAX_FACE_COUNT) { @@ -5001,7 +5082,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } } } - else if (mat->getSpecularID().notNull() && !mat->isSpecularInvalid()) + else if (mat->getSpecularID().notNull()) { //has specular map but no normal map, needs texcoord2 if (spec_count < MAX_FACE_COUNT) { @@ -5658,14 +5739,13 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE; LLMaterial* mat = te->getMaterialParams().get(); - U8 diffuse_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE; - bool can_be_shiny = true; + bool can_be_shiny = true; if (mat) { - diffuse_mode = mat->isDiffuseAlphaInvalid() ? LLMaterial::DIFFUSE_ALPHA_MODE_NONE : mat->getDiffuseAlphaMode(); - can_be_shiny = diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE || - diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE; + U8 mode = mat->getDiffuseAlphaMode(); + can_be_shiny = mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE || + mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE; } bool use_legacy_bump = te->getBumpmap() && (te->getBumpmap() < 18) && (!mat || mat->getNormalID().isNull()); @@ -5681,7 +5761,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac // if (te->getFullbright()) { - if (diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) + if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) { if (opaque) { @@ -5760,7 +5840,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac } else if (mat) { - U8 mode = diffuse_mode; + U8 mode = mat->getDiffuseAlphaMode(); if (te->getColor().mV[3] < 0.999f) { mode = LLMaterial::DIFFUSE_ALPHA_MODE_BLEND; @@ -5856,7 +5936,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac } else if (fullbright || bake_sunlight) { //fullbright - if (mat && diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) + if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) { registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK); } @@ -5878,7 +5958,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac else { //all around simple llassert(mask & LLVertexBuffer::MAP_NORMAL); - if (mat && diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) + if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) { //material alpha mask can be respected in non-deferred registerFace(group, facep, LLRenderPass::PASS_ALPHA_MASK); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 138d186e06..d3be5fea1a 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1691,7 +1691,7 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima alpha = alpha || (imagep->getComponents() == 4 && imagep->getType() != LLViewerTexture::MEDIA_TEXTURE) || (imagep->getComponents() == 2); } - if (alpha && mat && !mat->isDiffuseAlphaInvalid()) + if (alpha && mat) { switch (mat->getDiffuseAlphaMode()) { @@ -1712,7 +1712,7 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima { return LLDrawPool::POOL_ALPHA; } - else if ((te->getBumpmap() || te->getShiny()) && (!mat || mat->getNormalID().isNull() || mat->isNormalInvalid())) + else if ((te->getBumpmap() || te->getShiny()) && (!mat || mat->getNormalID().isNull())) { return LLDrawPool::POOL_BUMP; } |