diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-11-13 14:26:15 +0200 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-11-13 14:26:15 +0200 |
commit | 9de2af8b2dde7dc326f970d61950bebc565883f6 (patch) | |
tree | 87d799179a0fdb1ad6279f62a4f41747dedfce19 /indra | |
parent | 8da9e0ffd73e30a55734864e49a6ec917e3bee00 (diff) |
MAINT-7847 Remake of 'white alpfa' fix
Diffstat (limited to 'indra')
-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 | 36 | ||||
-rw-r--r-- | indra/newview/llface.h | 5 | ||||
-rw-r--r-- | indra/newview/llviewertexture.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llviewertexture.h | 5 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 183 | ||||
-rw-r--r-- | indra/newview/llvovolume.h | 22 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 4 |
10 files changed, 270 insertions, 42 deletions
diff --git a/indra/llprimitive/llmaterial.cpp b/indra/llprimitive/llmaterial.cpp index 57ceb3e11b..e6d2790a5f 100644 --- a/indra/llprimitive/llmaterial.cpp +++ b/indra/llprimitive/llmaterial.cpp @@ -106,10 +106,16 @@ 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); } @@ -199,13 +205,17 @@ 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()) + if (getSpecularID().notNull() && !mIsSpecularInvalid) { ret |= SPEC_BIT; } @@ -214,7 +224,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()) + if (getNormalID().notNull() && !mIsNormalInvalid) { ret |= NORM_BIT; } diff --git a/indra/llprimitive/llmaterial.h b/indra/llprimitive/llmaterial.h index 9f52a3f6c1..2f23a50973 100644 --- a/indra/llprimitive/llmaterial.h +++ b/indra/llprimitive/llmaterial.h @@ -120,6 +120,13 @@ 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; @@ -147,6 +154,10 @@ 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 8128790eb6..97dda072e7 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()) + if (mat->getSpecularID().isNull() || mat->isSpecularInvalid()) { 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) + if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && !mat->isDiffuseAlphaInvalid()) { sVertexProgram->setMinimumAlpha(mat->getAlphaMaskCutoff()/255.f); } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index c6fff6e57a..d502e686c7 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -344,6 +344,34 @@ void LLFace::dirtyTexture() gPipeline.markTextured(drawablep); } +void LLFace::notifyAboutCreatingTexture(LLViewerTexture *texture) +{ + LLDrawable* drawablep = getDrawable(); + if(mVObjp.notNull() && mVObjp->getVolume()) + { + LLVOVolume *vobj = drawablep->getVOVolume(); + if(vobj && vobj->notifyAboutCreatingTexture(texture)) + { + gPipeline.markTextured(drawablep); + gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_VOLUME); + } + } +} + +void LLFace::notifyAboutMissingAsset(LLViewerTexture *texture) +{ + LLDrawable* drawablep = getDrawable(); + if(mVObjp.notNull() && mVObjp->getVolume()) + { + LLVOVolume *vobj = drawablep->getVOVolume(); + if(vobj && vobj->notifyAboutMissingAsset(texture)) + { + gPipeline.markTextured(drawablep); + gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_VOLUME); + } + } +} + void LLFace::switchTexture(U32 ch, LLViewerTexture* new_texture) { llassert(ch < LLRender::NUM_TEXTURE_CHANNELS); @@ -1056,7 +1084,7 @@ bool LLFace::canRenderAsMask() } LLMaterial* mat = te->getMaterialParams(); - if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) + if (mat && !mat->isDiffuseAlphaInvalid() && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) { return false; } @@ -1290,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()) + if (!mat || mat->getSpecularID().isNull() || mat->isSpecularInvalid()) { shiny_in_alpha = true; } } else { - if (!mat || mat->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_MASK) + if (!mat || mat->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_MASK || mat->isDiffuseAlphaInvalid()) { shiny_in_alpha = true; } @@ -1783,7 +1811,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, std::vector<LLVector2> bump_tc; - if (mat && !mat->getNormalID().isNull()) + if (mat && !(mat->getNormalID().isNull() || mat->isNormalInvalid())) { //writing out normal and specular texture coordinates, not bump offsets do_bump = false; } diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 2d88c6fa58..ee545acb94 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -230,10 +230,13 @@ public: static U32 getRiggedDataMask(U32 type); + void notifyAboutCreatingTexture(LLViewerTexture *texture); + void notifyAboutMissingAsset(LLViewerTexture *texture); + public: //aligned members LLVector4a mExtents[2]; -private: +private: F32 adjustPartialOverlapPixelArea(F32 cos_angle_to_view_dir, F32 radius ); BOOL calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) ; public: diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 840176c1e0..e5a1bed48c 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -669,12 +669,36 @@ S8 LLViewerTexture::getType() const void LLViewerTexture::cleanup() { + notifyAboutMissingAsset(); + mFaceList[LLRender::DIFFUSE_MAP].clear(); mFaceList[LLRender::NORMAL_MAP].clear(); mFaceList[LLRender::SPECULAR_MAP].clear(); mVolumeList.clear(); } +void LLViewerTexture::notifyAboutCreatingTexture() +{ + for(U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch) + { + for(U32 f = 0; f < mNumFaces[ch]; f++) + { + mFaceList[ch][f]->notifyAboutCreatingTexture(this); + } + } +} + +void LLViewerTexture::notifyAboutMissingAsset() +{ + for(U32 ch = 0; ch < LLRender::NUM_TEXTURE_CHANNELS; ++ch) + { + for(U32 f = 0; f < mNumFaces[ch]; f++) + { + mFaceList[ch][f]->notifyAboutMissingAsset(this); + } + } +} + // virtual void LLViewerTexture::dump() { @@ -1474,6 +1498,8 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) res = mGLTexturep->createGLTexture(mRawDiscardLevel, mRawImage, usename, TRUE, mBoostLevel); + notifyAboutCreatingTexture(); + setActive(); if (!needsToSaveRawImage()) @@ -2198,6 +2224,8 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) } if (is_missing) { + notifyAboutMissingAsset(); + if (mUrl.empty()) { LL_WARNS() << mID << ": Marking image as missing" << LL_ENDL; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 9208b4813e..c9dea17f63 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -175,6 +175,10 @@ protected: void init(bool firstinit) ; void reorganizeFaceList() ; void reorganizeVolumeList() ; + + void notifyAboutMissingAsset(); + void notifyAboutCreatingTexture(); + private: friend class LLBumpImageList; friend class LLUIImageList; @@ -312,6 +316,7 @@ public: void addToCreateTexture(); + // ONLY call from LLViewerTextureList BOOL createTexture(S32 usename = 0); void destroyTexture() ; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 20c54d06d3..206d34d7ea 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2051,28 +2051,148 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) return res; } +bool LLVOVolume::notifyAboutCreatingTexture(LLViewerTexture *texture) +{ + // Texture was created, process it and remove from wait list + + 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; + + 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 + + cur_material->setDiffuseAlphaInvalid(true); + needs_update = true; + } + } + + //clear wait-list + mWaitingTextureInfo.erase(range.first, range.second); + + return needs_update; +} + +bool LLVOVolume::notifyAboutMissingAsset(LLViewerTexture *texture) +{ + // Texture was marked as missing, process it and remove from wait list + + 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; + + 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) + { + case LLRender::DIFFUSE_MAP: + { + cur_material->setDiffuseAlphaInvalid(true); + break; + } + case LLRender::NORMAL_MAP: + { + cur_material->setNormalInvalid(true); + break; + } + case LLRender::SPECULAR_MAP: + { + cur_material->setSpecularInvalid(true); + break; + } + default: + break; + } + } + + //clear wait-list + mWaitingTextureInfo.erase(range.first, range.second); + + return true; +} + S32 LLVOVolume::setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams) { LLMaterialPtr pMaterial = const_cast<LLMaterialPtr&>(pMaterialParams); if(pMaterialParams) - { - LLViewerTexture* image = getTEImage(te); - LLGLenum image_format = image ? image->getPrimaryFormat() : GL_RGB; - LLMaterialPtr current_material = getTEMaterialParams(te); + { //check all of them according to material settings - U8 new_diffuse_alpha_mode = pMaterialParams->getDiffuseAlphaMode(); + LLViewerTexture *img_diffuse = getTEImage(te); + LLViewerTexture *img_normal = getTENormalMap(te); + LLViewerTexture *img_specular = getTESpecularMap(te); - if(new_diffuse_alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) + llassert(NULL != img_diffuse); + + //diffuse + if(NULL != img_diffuse) { - new_diffuse_alpha_mode = (GL_RGB == image_format || 0 == image_format ? LLMaterial::DIFFUSE_ALPHA_MODE_NONE : new_diffuse_alpha_mode); + if(0 == img_diffuse->getPrimaryFormat() && !img_diffuse->isMissingAsset()) + { + // Texture information is missing, wait for it + mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(img_diffuse->getID(), material_info(LLRender::DIFFUSE_MAP, te))); + } + else + { + if(img_diffuse->isMissingAsset()) + { + pMaterial->setDiffuseAlphaInvalid(true); + } + else if (GL_RGBA != img_diffuse->getPrimaryFormat() + && pMaterialParams->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_NONE + && pMaterialParams->getDiffuseAlphaMode() != LLMaterial::DIFFUSE_ALPHA_MODE_DEFAULT) + { + pMaterial->setDiffuseAlphaInvalid(true); + } + } } - if(pMaterialParams->getDiffuseAlphaMode() != new_diffuse_alpha_mode) { - //create new material - pMaterial = new LLMaterial(pMaterialParams->asLLSD()); - pMaterial->setDiffuseAlphaMode(new_diffuse_alpha_mode); - LLMaterialMgr::getInstance()->put(getID(),te,*pMaterial); + //normal + if(LLUUID::null != pMaterialParams->getNormalID()) + { + if(img_normal && img_normal->isMissingAsset() && img_normal->getID() == pMaterialParams->getNormalID()) + { + pMaterial->setNormalInvalid(true); + } + else if(NULL == img_normal || 0 == img_normal->getPrimaryFormat()) + { + // Texture information is missing, wait for it + mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getNormalID(), material_info(LLRender::NORMAL_MAP,te))); + } + + } + + + //specular + if(LLUUID::null != pMaterialParams->getSpecularID()) + { + if(img_specular && img_specular->isMissingAsset() && img_specular->getID() == pMaterialParams->getSpecularID()) + { + pMaterial->setSpecularInvalid(true); + } + else if(NULL == img_specular || 0 == img_specular->getPrimaryFormat()) + { + // Texture information is missing, wait for it + mWaitingTextureInfo.insert(mmap_UUID_MAP_t::value_type(pMaterialParams->getSpecularID(), material_info(LLRender::SPECULAR_MAP, te))); + } } } @@ -4365,7 +4485,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, } draw_info->mAlphaMaskCutoff = mat->getAlphaMaskCutoff() * (1.f / 255.f); - draw_info->mDiffuseAlphaMode = mat->getDiffuseAlphaMode(); + draw_info->mDiffuseAlphaMode = mat->isDiffuseAlphaInvalid() ? LLMaterial::DIFFUSE_ALPHA_MODE_NONE : mat->getDiffuseAlphaMode(); draw_info->mNormalMap = facep->getViewerObject()->getTENormalMap(facep->getTEOffset()); } @@ -4634,11 +4754,14 @@ 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); @@ -4658,11 +4781,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { bool fullbright = te->getFullbright(); bool is_alpha = type == LLDrawPool::POOL_ALPHA; - U8 mode = mat->getDiffuseAlphaMode(); - bool can_be_shiny = mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE || - mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE; + bool can_be_shiny = alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE || + alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE; - if (mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && te->getColor().mV[3] >= 0.999f) + if (alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK && te->getColor().mV[3] >= 0.999f) { pool->addRiggedFace(facep, fullbright ? LLDrawPoolAvatar::RIGGED_FULLBRIGHT : LLDrawPoolAvatar::RIGGED_SIMPLE); } @@ -4862,9 +4984,9 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (LLPipeline::sRenderDeferred && te->getMaterialParams().notNull() && !te->getMaterialID().isNull()) { LLMaterial* mat = te->getMaterialParams().get(); - if (mat->getNormalID().notNull()) + if (mat->getNormalID().notNull() && !mat->isNormalInvalid()) { - if (mat->getSpecularID().notNull()) + if (mat->getSpecularID().notNull() && !mat->isSpecularInvalid()) { //has normal and specular maps (needs texcoord1, texcoord2, and tangent) if (normspec_count < MAX_FACE_COUNT) { @@ -4879,7 +5001,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } } } - else if (mat->getSpecularID().notNull()) + else if (mat->getSpecularID().notNull() && !mat->isSpecularInvalid()) { //has specular map but no normal map, needs texcoord2 if (spec_count < MAX_FACE_COUNT) { @@ -5536,13 +5658,14 @@ 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; + if (mat) { - U8 mode = mat->getDiffuseAlphaMode(); - can_be_shiny = mode == LLMaterial::DIFFUSE_ALPHA_MODE_NONE || - mode == LLMaterial::DIFFUSE_ALPHA_MODE_EMISSIVE; + 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; } bool use_legacy_bump = te->getBumpmap() && (te->getBumpmap() < 18) && (!mat || mat->getNormalID().isNull()); @@ -5558,7 +5681,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac // if (te->getFullbright()) { - if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) + if (diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) { if (opaque) { @@ -5637,7 +5760,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac } else if (mat) { - U8 mode = mat->getDiffuseAlphaMode(); + U8 mode = diffuse_mode; if (te->getColor().mV[3] < 0.999f) { mode = LLMaterial::DIFFUSE_ALPHA_MODE_BLEND; @@ -5733,7 +5856,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac } else if (fullbright || bake_sunlight) { //fullbright - if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) + if (mat && diffuse_mode == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) { registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK); } @@ -5755,7 +5878,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFac else { //all around simple llassert(mask & LLVertexBuffer::MAP_NORMAL); - if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) + if (mat && diffuse_mode == 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/llvovolume.h b/indra/newview/llvovolume.h index b07d416363..a331908320 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -380,7 +380,7 @@ public: static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop static F32 sLODFactor; // LOD scale factor static F32 sDistanceFactor; // LOD distance factor - + static LLPointer<LLObjectMediaDataClient> sObjectMediaClient; static LLPointer<LLObjectMediaNavigateClient> sObjectMediaNavigateClient; @@ -388,6 +388,26 @@ protected: static S32 sNumLODChanges; friend class LLVolumeImplFlexible; + +public: + bool notifyAboutCreatingTexture(LLViewerTexture *texture); + bool notifyAboutMissingAsset(LLViewerTexture *texture); + +private: + struct material_info + { + LLRender::eTexIndex map; + U8 te; + + material_info(LLRender::eTexIndex map_, U8 te_) + : map(map_) + , te(te_) + {} + }; + + typedef std::multimap<LLUUID, material_info> mmap_UUID_MAP_t; + mmap_UUID_MAP_t mWaitingTextureInfo; + }; #endif // LL_LLVOVOLUME_H diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index d3be5fea1a..138d186e06 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) + if (alpha && mat && !mat->isDiffuseAlphaInvalid()) { 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())) + else if ((te->getBumpmap() || te->getShiny()) && (!mat || mat->getNormalID().isNull() || mat->isNormalInvalid())) { return LLDrawPool::POOL_BUMP; } |