From fb73cf01afba88c60ba7eab074f66a08e07638b1 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham)" Date: Wed, 1 May 2013 11:56:15 -0700 Subject: NORSPEC-144 make code to nerf use of FBOs on old windows drivers not affect Mac too --- indra/llrender/llgl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 8431744892..088ba95b75 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -760,12 +760,13 @@ bool LLGLManager::initGL() { //using multisample textures on ATI results in black screen for some reason mHasTextureMultisample = FALSE; } -#endif + if (mIsIntel && mGLVersion <= 3.f) { //never try to use framebuffer objects on older intel drivers (crashy) mHasFramebufferObject = FALSE; } +#endif if (mHasFramebufferObject) { -- cgit v1.2.3 From de582bfe86bcea428bd309d30578d5aa51a4d007 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Thu, 2 May 2013 10:20:55 -0700 Subject: NORSPEC-99 add break statement to fix legacy bump vert program from being stomped with inappropriate material prog sans skinning --- indra/newview/lldrawpoolavatar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index ef8df305e3..69f10cd4df 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -182,6 +182,7 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass) break; case 4: beginDeferredRiggedBump(); + break; default: beginDeferredRiggedMaterial(pass-5); break; -- cgit v1.2.3 From 1a880b47ab7176a78f39a1681f00e2e6a32321ad Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Wed, 1 May 2013 19:03:09 -0700 Subject: NORSPEC-119 redux : fix getState to find the material ID of individually selected faces correctly --- indra/newview/llpanelface.cpp | 117 ++++++++++++++++++++++++------------------ 1 file changed, 68 insertions(+), 49 deletions(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 67ef072508..79673fa868 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1569,19 +1569,30 @@ void LLPanelFace::getState() LLMaterialID get(LLViewerObject* object, S32 te_index) { LLMaterialID material_id; - + return object->getTE(te_index)->getMaterialID(); } } func; - identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, mMaterialID ); - llinfos << "Material ID returned: '" - << mMaterialID.asString() << "', isNull? " - << (mMaterialID.isNull()?"TRUE":"FALSE") << llendl; + + LLObjectSelectionHandle sel = LLSelectMgr::getInstance()->getSelection(); + LLSelectNode* node = sel->getFirstNode(); + if (node) + { + int selected_te = node->getLastSelectedTE(); + if (selected_te >= 0) + { + mMaterialID = node->getObject()->getTE(selected_te)->getMaterialID(); + } + } + + llinfos << "Material ID returned: '" << mMaterialID.asString() << "', isNull? " << (mMaterialID.isNull()?"TRUE":"FALSE") << llendl; + if (!mMaterialID.isNull() && editable) { llinfos << "Requesting material ID " << mMaterialID.asString() << llendl; - LLMaterialMgr::getInstance()->get(objectp->getRegion()->getRegionID(),mMaterialID,boost::bind(&LLPanelFace::onMaterialLoaded, this, _1, _2)); + LLMaterialMgr::getInstance()->get(objectp->getRegion()->getRegionID(),mMaterialID,boost::bind(&LLPanelFace::onMaterialLoaded, this, _1, _2)); } + } // Set variable values for numeric expressions @@ -1774,14 +1785,38 @@ void LLPanelFace::updateMaterial() mMaterial = LLMaterialPtr(new LLMaterial()); } - mMaterial->setDiffuseAlphaMode(getChild("combobox alphamode")->getCurrentIndex()); - mMaterial->setAlphaMaskCutoff((U8)(getChild("maskcutoff")->getValue().asInteger())); + LLMaterialPtr material_to_set = mMaterial; + + // If we're editing a single face and not the entire material for an object, + // we need to clone the material so that our changes to the material's settings + // don't automatically propagate to the non-selected faces + // NORSPEC-92 + // + LLObjectSelectionHandle sel = LLSelectMgr::getInstance()->getSelection(); + LLSelectNode* node = sel->getFirstNode(); + if (node) + { + if (node->getTESelectMask() != TE_SELECT_MASK_ALL) + { + llinfos << "Cloning material to apply to subselection." << llendl; + material_to_set = new LLMaterial(mMaterial->asLLSD()); + } + else + { + llinfos << "Apply material change to whole selection." << llendl; + } + } + + llassert(!material_to_set.isNull()); + + material_to_set->setDiffuseAlphaMode(getChild("combobox alphamode")->getCurrentIndex()); + material_to_set->setAlphaMaskCutoff((U8)(getChild("maskcutoff")->getValue().asInteger())); LLUUID norm_map_id = getChild("bumpytexture control")->getImageAssetID(); if (!norm_map_id.isNull()) { LL_DEBUGS("Materials") << "Setting bumpy texture, bumpiness = " << bumpiness << LL_ENDL; - mMaterial->setNormalID(norm_map_id); + material_to_set->setNormalID(norm_map_id); F32 bumpy_scale_u = getChild("bumpyScaleU")->getValue().asReal(); F32 bumpy_scale_v = getChild("bumpyScaleV")->getValue().asReal(); @@ -1792,18 +1827,18 @@ void LLPanelFace::updateMaterial() bumpy_scale_v *= 0.5f; } - mMaterial->setNormalOffset(getChild("bumpyOffsetU")->getValue().asReal(), + material_to_set->setNormalOffset(getChild("bumpyOffsetU")->getValue().asReal(), getChild("bumpyOffsetV")->getValue().asReal()); - mMaterial->setNormalRepeat(bumpy_scale_u, bumpy_scale_v); - mMaterial->setNormalRotation(getChild("bumpyRot")->getValue().asReal()*DEG_TO_RAD); + material_to_set->setNormalRepeat(bumpy_scale_u, bumpy_scale_v); + material_to_set->setNormalRotation(getChild("bumpyRot")->getValue().asReal()*DEG_TO_RAD); } else { LL_DEBUGS("Materials") << "Removing bumpy texture, bumpiness = " << bumpiness << LL_ENDL; - mMaterial->setNormalID(LLUUID()); - mMaterial->setNormalOffset(0.0f,0.0f); - mMaterial->setNormalRepeat(1.0f,1.0f); - mMaterial->setNormalRotation(0.0f); + material_to_set->setNormalID(LLUUID()); + material_to_set->setNormalOffset(0.0f,0.0f); + material_to_set->setNormalRepeat(1.0f,1.0f); + material_to_set->setNormalRotation(0.0f); } LLUUID spec_map_id = getChild("shinytexture control")->getImageAssetID(); @@ -1811,8 +1846,8 @@ void LLPanelFace::updateMaterial() if (!spec_map_id.isNull()) { LL_DEBUGS("Materials") << "Setting shiny texture, shininess = " << shininess << LL_ENDL; - mMaterial->setSpecularID(spec_map_id); - mMaterial->setSpecularOffset(getChild("shinyOffsetU")->getValue().asReal(), + material_to_set->setSpecularID(spec_map_id); + material_to_set->setSpecularOffset(getChild("shinyOffsetU")->getValue().asReal(), getChild("shinyOffsetV")->getValue().asReal()); F32 shiny_scale_u = getChild("shinyScaleU")->getValue().asReal(); @@ -1824,48 +1859,32 @@ void LLPanelFace::updateMaterial() shiny_scale_v *= 0.5f; } - mMaterial->setSpecularRepeat(shiny_scale_u, shiny_scale_v); - mMaterial->setSpecularRotation(getChild("shinyRot")->getValue().asReal()*DEG_TO_RAD); + material_to_set->setSpecularRepeat(shiny_scale_u, shiny_scale_v); + material_to_set->setSpecularRotation(getChild("shinyRot")->getValue().asReal()*DEG_TO_RAD); //override shininess to 0.2f if this is a new material if (!new_material) { - mMaterial->setSpecularLightColor(getChild("shinycolorswatch")->get()); - mMaterial->setSpecularLightExponent(getChild("glossiness")->getValue().asInteger()); - mMaterial->setEnvironmentIntensity(getChild("environment")->getValue().asInteger()); + material_to_set->setSpecularLightColor(getChild("shinycolorswatch")->get()); + material_to_set->setSpecularLightExponent(getChild("glossiness")->getValue().asInteger()); + material_to_set->setEnvironmentIntensity(getChild("environment")->getValue().asInteger()); } } else { LL_DEBUGS("Materials") << "Removing shiny texture, shininess = " << shininess << LL_ENDL; - mMaterial->setSpecularID(LLUUID()); - mMaterial->setSpecularOffset(0.0f,0.0f); - mMaterial->setSpecularRepeat(1.0f,1.0f); - mMaterial->setSpecularRotation(0.0f); - mMaterial->setSpecularLightColor(LLMaterial::DEFAULT_SPECULAR_LIGHT_COLOR); - mMaterial->setSpecularLightExponent(LLMaterial::DEFAULT_SPECULAR_LIGHT_EXPONENT); - mMaterial->setEnvironmentIntensity(0); + material_to_set->setSpecularID(LLUUID()); + material_to_set->setSpecularOffset(0.0f,0.0f); + material_to_set->setSpecularRepeat(1.0f,1.0f); + material_to_set->setSpecularRotation(0.0f); + material_to_set->setSpecularLightColor(LLMaterial::DEFAULT_SPECULAR_LIGHT_COLOR); + material_to_set->setSpecularLightExponent(LLMaterial::DEFAULT_SPECULAR_LIGHT_EXPONENT); + material_to_set->setEnvironmentIntensity(0); } - LL_DEBUGS("Materials") << "Updating material: " << mMaterial->asLLSD() << LL_ENDL; - - LLMaterialPtr material_to_set = mMaterial; - - // If we're editing a single face and not the entire material for an object, - // we need to clone the material so that our changes to the material's settings - // don't automatically propagate to the non-selected faces - // NORSPEC-92 - // - LLObjectSelectionHandle sel = LLSelectMgr::getInstance()->getSelection(); - LLSelectNode* node = sel->getFirstNode(); - if (node) - { - if (node->getTESelectMask() != TE_SELECT_MASK_ALL) - { - material_to_set = new LLMaterial(*mMaterial); - } - } - LLSelectMgr::getInstance()->selectionSetMaterial( material_to_set ); + LL_DEBUGS("Materials") << "Updating material: " << material_to_set->asLLSD() << LL_ENDL; + + LLSelectMgr::getInstance()->selectionSetMaterial( material_to_set ); } else { -- cgit v1.2.3 From 6bb9c2720e42be43741e470fb5b347686e584b6b Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 2 May 2013 12:35:48 -0500 Subject: NORSPEC-149 Fix for objects set to alpha blend sometimes getting tossed into alpha mask pool. --- indra/newview/llface.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 6474e1b1de..08a16c9c33 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1097,6 +1097,12 @@ bool LLFace::canRenderAsMask() { return false; } + + LLMaterial* mat = te->getMaterialParams(); + if (mat && mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) + { + return false; + } if ((te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask -- cgit v1.2.3 From dd06eb40213d8429b34b5ee90cdb682924e976dc Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Thu, 2 May 2013 13:05:25 -0700 Subject: NORSPEC-157 make texture repeats/offsets controls display in media mode --- indra/newview/llpanelface.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 79673fa868..1a3f4832fd 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1953,11 +1953,11 @@ void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata) U32 materials_media = combo_matmedia->getCurrentIndex(); U32 material_type = combo_mattype->getCurrentIndex(); bool show_media = (materials_media == MATMEDIA_MEDIA) && combo_matmedia->getEnabled(); - bool show_texture = (!show_media) && (material_type == MATTYPE_DIFFUSE) && combo_matmedia->getEnabled(); + bool show_texture = (show_media || ((material_type == MATTYPE_DIFFUSE) && combo_matmedia->getEnabled())); bool show_bumpiness = (!show_media) && (material_type == MATTYPE_NORMAL) && combo_matmedia->getEnabled(); bool show_shininess = (!show_media) && (material_type == MATTYPE_SPECULAR) && combo_matmedia->getEnabled(); self->getChildView("combobox mattype")->setVisible(!show_media); - self->getChildView("rptctrl")->setVisible(!show_media); + self->getChildView("rptctrl")->setVisible(show_texture); // Media controls self->getChildView("media_info")->setVisible(show_media); @@ -1966,12 +1966,12 @@ void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata) self->getChildView("button align")->setVisible(show_media); // Diffuse texture controls - self->getChildView("texture control")->setVisible(show_texture); - self->getChildView("label alphamode")->setVisible(show_texture); - self->getChildView("combobox alphamode")->setVisible(show_texture); + self->getChildView("texture control")->setVisible(show_texture && !show_media); + self->getChildView("label alphamode")->setVisible(show_texture && !show_media); + self->getChildView("combobox alphamode")->setVisible(show_texture && !show_media); self->getChildView("label maskcutoff")->setVisible(false); self->getChildView("maskcutoff")->setVisible(false); - if (show_texture) + if (show_texture && !show_media) { updateAlphaControls(ctrl, userdata); } -- cgit v1.2.3