diff options
-rwxr-xr-x | indra/newview/llpanelface.h | 3 | ||||
-rwxr-xr-x | indra/newview/llvovolume.cpp | 13 |
2 files changed, 11 insertions, 5 deletions
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 84aba4dc89..2dd24f4376 100755 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -258,7 +258,8 @@ private: if (!is_need_material) { LL_DEBUGS("Materials") << "Removing material from object " << object->getID() << " face " << face << LL_ENDL; - LLMaterialMgr::getInstance()->remove(object->getID(),face); + LLMaterialMgr::getInstance()->remove(object->getID(),face); + object->setTEMaterialID(face, LLMaterialID::null); } else { diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 677d79d601..19754774db 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4105,7 +4105,6 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, //drawable->getVObj()->setDebugText(llformat("%d", drawable->isState(LLDrawable::ANIMATED_CHILD))); U8 bump = (type == LLRenderPass::PASS_BUMP || type == LLRenderPass::PASS_POST_BUMP) ? facep->getTextureEntry()->getBumpmap() : 0; - U8 shiny = facep->getTextureEntry()->getShiny(); LLViewerTexture* tex = facep->getTexture(); @@ -4115,6 +4114,8 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, LLMaterial* mat = facep->getTextureEntry()->getMaterialParams().get(); LLMaterialID mat_id = facep->getTextureEntry()->getMaterialID(); + mat = mat_id.isNull() ? NULL : mat; + bool batchable = false; U32 shader_mask = 0xFFFFFFFF; //no shader @@ -4200,6 +4201,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, draw_info->mTextureMatrix = tex_mat; draw_info->mModelMatrix = model_mat; + draw_info->mBump = bump; draw_info->mShiny = shiny; float alpha[4] = @@ -4544,6 +4546,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } LLMaterial* mat = te->getMaterialParams().get(); + mat = te->getMaterialID().isNull() ? NULL : mat; if (mat && LLPipeline::sRenderDeferred) { @@ -4755,7 +4758,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (gPipeline.canUseWindLightShadersOnObjects() && LLPipeline::sRenderBump) { - if (LLPipeline::sRenderDeferred && te->getMaterialParams().notNull()) + if (LLPipeline::sRenderDeferred && te->getMaterialParams().notNull() && !te->getMaterialID().isNull()) { LLMaterial* mat = te->getMaterialParams().get(); if (mat->getNormalID().notNull()) @@ -5332,6 +5335,8 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: LLMaterial* mat = te->getMaterialParams().get(); + mat = te->getMaterialID().isNull() ? NULL : mat; + bool can_be_shiny = true; if (mat) { @@ -5489,7 +5494,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: registerFace(group, facep, LLRenderPass::PASS_POST_BUMP); } } - else if (te->getBumpmap() && !te->getMaterialParams()) + else if (te->getBumpmap() && !mat) { //register in deferred bump pass registerFace(group, facep, LLRenderPass::PASS_BUMP); } @@ -5531,7 +5536,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } else { - if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && (te->getBumpmap() && !te->getMaterialParams())) + if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && (te->getBumpmap() && !mat)) { //non-shiny or fullbright deferred bump registerFace(group, facep, LLRenderPass::PASS_BUMP); } |