From 5acb0b3a32ebac89a4c6347ee88278f580fdd458 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Mon, 20 May 2013 11:56:48 -0700 Subject: NORSPEC-168 fix UI update to not re-add the 'Use Texture' item when selecting legacy bump settings --- indra/newview/llpanelface.cpp | 176 +++++++++++++++++++++--------------------- 1 file changed, 88 insertions(+), 88 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index 1d99e9d162..a5e33f3dd5 100755 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -300,16 +300,13 @@ void LLPanelFace::sendBump() { LL_DEBUGS("Materials") << "clearing bumptexture control" << LL_ENDL; LLTextureCtrl* bumpytexture_ctrl = getChild("bumpytexture control"); - bumpytexture_ctrl->clear(); - LLSD dummy_data; - onSelectNormalTexture(dummy_data); + bumpytexture_ctrl->setImageAssetID(LLUUID()); } U8 bump = (U8) bumpiness & TEM_BUMP_MASK; LLSelectMgr::getInstance()->selectionSetBumpmap( bump ); - //refresh material state (in case this change impacts material params) - LLSD dummy_data; - onCommitNormalTexture(dummy_data); + updateBumpyControls(bumpiness == BUMPY_TEXTURE, true); + updateMaterial(); } void LLPanelFace::sendTexGen() @@ -333,9 +330,8 @@ void LLPanelFace::sendShiny() U8 shiny = (U8) shininess & TEM_SHINY_MASK; LLSelectMgr::getInstance()->selectionSetShiny( shiny ); - //refresh material state (in case this change impacts material params) - LLSD dummy_data; - onCommitSpecularTexture(dummy_data); + updateShinyControls(shininess == SHINY_TEXTURE, true); + updateMaterial(); } void LLPanelFace::sendFullbright() @@ -693,6 +689,79 @@ void LLPanelFace::updateUI() getChildView("ColorTrans")->setEnabled(editable); } + U8 shiny = 0; + + // Shiny + { + struct f9 : public LLSelectedTEGetFunctor + { + U8 get(LLViewerObject* object, S32 face) + { + return (U8)(object->getTE(face)->getShiny()); + } + } func; + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, shiny ); + + LLCtrlSelectionInterface* combobox_shininess = + childGetSelectionInterface("combobox shininess"); + if (combobox_shininess) + { + combobox_shininess->selectNthItem((S32)shiny); + } + else + { + llwarns << "failed childGetSelectionInterface for 'combobox shininess'" << llendl; + } + getChildView("combobox shininess")->setEnabled(editable); + getChild("combobox shininess")->setTentative(!identical); + getChildView("label shininess")->setEnabled(editable); + getChildView("glossiness")->setEnabled(editable); + getChild("glossiness")->setTentative(!identical); + getChildView("label glossiness")->setEnabled(editable); + getChildView("environment")->setEnabled(editable); + getChild("environment")->setTentative(!identical); + getChildView("label environment")->setEnabled(editable); + getChild("shinycolorswatch")->setTentative(!identical); + getChildView("label shinycolor")->setEnabled(editable); + } + + LLColorSwatchCtrl* mShinyColorSwatch = getChild("shinycolorswatch"); + if(mShinyColorSwatch) + { + mShinyColorSwatch->setValid(editable); + mShinyColorSwatch->setEnabled( editable ); + mShinyColorSwatch->setCanApplyImmediately( editable ); + } + + U8 bumpy = 0; + + // Bumpy + { + struct f10 : public LLSelectedTEGetFunctor + { + U8 get(LLViewerObject* object, S32 face) + { + return object->getTE(face)->getBumpmap(); + } + } func; + identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, bumpy ); + + LLUUID norm_map_id = getChild("bumpytexture control")->getImageAssetID(); + + LLCtrlSelectionInterface* combobox_bumpiness = childGetSelectionInterface("combobox bumpiness"); + if (combobox_bumpiness) + { + combobox_bumpiness->selectNthItem((S32)bumpy); + } + else + { + llwarns << "failed childGetSelectionInterface for 'combobox bumpiness'" << llendl; + } + getChildView("combobox bumpiness")->setEnabled(editable); + getChild("combobox bumpiness")->setTentative(!identical); + getChildView("label bumpiness")->setEnabled(editable); + } + // Texture { struct f1 : public LLSelectedTEGetFunctor @@ -744,6 +813,9 @@ void LLPanelFace::updateUI() } norm_get_func; identical_norm = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &norm_get_func, normmap_id ); + if (bumpy != BUMPY_TEXTURE) + normmap_id = LLUUID::null; + // Specular map struct spec_get : public LLSelectedTEGetFunctor { @@ -763,6 +835,9 @@ void LLPanelFace::updateUI() } spec_get_func; identical_spec = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &spec_get_func, specmap_id ); + if (shiny != SHINY_TEXTURE) + specmap_id = LLUUID::null; + mIsAlpha = FALSE; LLGLenum image_format; struct f2 : public LLSelectedTEGetFunctor @@ -801,7 +876,7 @@ void LLPanelFace::updateUI() getChildView("button align")->setEnabled(editable); } - // Specular map + // Diffuse Alpha Mode struct alpha_get : public LLSelectedTEGetFunctor { U8 get(LLViewerObject* object, S32 te_index) @@ -897,7 +972,7 @@ void LLPanelFace::updateUI() else if (specmap_id.isNull()) { shinytexture_ctrl->setTentative( FALSE ); - shinytexture_ctrl->setEnabled( FALSE ); + shinytexture_ctrl->setEnabled( editable ); shinytexture_ctrl->setImageAssetID( LLUUID::null ); } else @@ -919,7 +994,7 @@ void LLPanelFace::updateUI() else if (normmap_id.isNull()) { bumpytexture_ctrl->setTentative( FALSE ); - bumpytexture_ctrl->setEnabled( FALSE ); + bumpytexture_ctrl->setEnabled( editable ); bumpytexture_ctrl->setImageAssetID( LLUUID::null ); } else @@ -1342,82 +1417,7 @@ void LLPanelFace::updateUI() } - U8 shiny = 0; - - // Shiny - { - struct f9 : public LLSelectedTEGetFunctor - { - U8 get(LLViewerObject* object, S32 face) - { - return (U8)(object->getTE(face)->getShiny()); - } - } func; - identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, shiny ); - - LLUUID spec_map_id = getChild("shinytexture control")->getImageAssetID(); - - LLCtrlSelectionInterface* combobox_shininess = - childGetSelectionInterface("combobox shininess"); - if (combobox_shininess) - { - combobox_shininess->selectNthItem(spec_map_id.isNull() ? (S32)shiny : SHINY_TEXTURE); - } - else - { - llwarns << "failed childGetSelectionInterface for 'combobox shininess'" << llendl; - } - getChildView("combobox shininess")->setEnabled(editable); - getChild("combobox shininess")->setTentative(!identical); - getChildView("label shininess")->setEnabled(editable); - getChildView("glossiness")->setEnabled(editable); - getChild("glossiness")->setTentative(!identical); - getChildView("label glossiness")->setEnabled(editable); - getChildView("environment")->setEnabled(editable); - getChild("environment")->setTentative(!identical); - getChildView("label environment")->setEnabled(editable); - getChild("shinycolorswatch")->setTentative(!identical); - getChildView("label shinycolor")->setEnabled(editable); - } - - LLColorSwatchCtrl* mShinyColorSwatch = getChild("shinycolorswatch"); - if(mShinyColorSwatch) - { - mShinyColorSwatch->setValid(editable); - mShinyColorSwatch->setEnabled( editable ); - mShinyColorSwatch->setCanApplyImmediately( editable ); - } - - U8 bumpy = 0; - - // Bumpy - { - struct f10 : public LLSelectedTEGetFunctor - { - U8 get(LLViewerObject* object, S32 face) - { - return object->getTE(face)->getBumpmap(); - } - } func; - identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, bumpy ); - - LLUUID norm_map_id = getChild("bumpytexture control")->getImageAssetID(); - - bumpy = norm_map_id.isNull() ? (S32)bumpy : BUMPY_TEXTURE; - - LLCtrlSelectionInterface* combobox_bumpiness = childGetSelectionInterface("combobox bumpiness"); - if (combobox_bumpiness) - { - combobox_bumpiness->selectNthItem(bumpy); - } - else - { - llwarns << "failed childGetSelectionInterface for 'combobox bumpiness'" << llendl; - } - getChildView("combobox bumpiness")->setEnabled(editable); - getChild("combobox bumpiness")->setTentative(!identical); - getChildView("label bumpiness")->setEnabled(editable); - } + { LLCtrlSelectionInterface* combobox_texgen = -- cgit v1.2.3 From 812241856738b065c8d324d5d978e754df198736 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 20 May 2013 17:07:41 -0500 Subject: NORSPEC-197 Fix for fullbright alpha masked objects not rendering --- indra/newview/pipeline.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 19ff1e852d..984ea446fe 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1699,7 +1699,14 @@ U32 LLPipeline::getPoolTypeFromTE(const LLTextureEntry* te, LLViewerTexture* ima alpha = color_alpha; break; default: //alpha mode set to "mask", go to alpha pool if fullbright - alpha = color_alpha; // Material's alpha mode is set to none, mask, or emissive. Toss it into the opaque material draw pool. + if (te->getFullbright()) + { + alpha = true; + } + else + { + alpha = color_alpha; // Material's alpha mode is set to none, mask, or emissive. Toss it into the opaque material draw pool. + } break; } } -- cgit v1.2.3 From a1a8048d3e1494d50f23bc1b6c66a238128fe82b Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Mon, 20 May 2013 16:24:58 -0700 Subject: NORSPEC-188 avoid removing 'Use Texture' item when cancelling from picker back to having prev texture --- indra/newview/llpanelface.cpp | 90 ++++++++++++++++++++++++++----------------- indra/newview/llpanelface.h | 4 +- indra/newview/llvovolume.cpp | 4 +- 3 files changed, 59 insertions(+), 39 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index a5e33f3dd5..ff362a5c6b 100755 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -291,17 +291,16 @@ void LLPanelFace::sendTexture() } } -void LLPanelFace::sendBump() +void LLPanelFace::sendBump(U32 bumpiness) { - LLComboBox* mComboBumpiness = getChild("combobox bumpiness"); - if(!mComboBumpiness)return; - U32 bumpiness = mComboBumpiness->getCurrentIndex(); if (bumpiness < BUMPY_TEXTURE) { LL_DEBUGS("Materials") << "clearing bumptexture control" << LL_ENDL; LLTextureCtrl* bumpytexture_ctrl = getChild("bumpytexture control"); + bumpytexture_ctrl->clear(); bumpytexture_ctrl->setImageAssetID(LLUUID()); } + U8 bump = (U8) bumpiness & TEM_BUMP_MASK; LLSelectMgr::getInstance()->selectionSetBumpmap( bump ); @@ -317,14 +316,12 @@ void LLPanelFace::sendTexGen() LLSelectMgr::getInstance()->selectionSetTexGen( tex_gen ); } -void LLPanelFace::sendShiny() +void LLPanelFace::sendShiny(U32 shininess) { - LLComboBox* mComboShininess = getChild("combobox shininess"); - if(!mComboShininess)return; - U32 shininess = mComboShininess->getCurrentIndex(); if (shininess < SHINY_TEXTURE) { LLTextureCtrl* texture_ctrl = getChild("shinytexture control"); + texture_ctrl->clear(); texture_ctrl->setImageAssetID(LLUUID()); } U8 shiny = (U8) shininess & TEM_SHINY_MASK; @@ -963,7 +960,7 @@ void LLPanelFace::updateUI() if (shinytexture_ctrl && !shinytexture_ctrl->isPickerShown()) { - if (identical_spec) + if (identical_spec && (shiny == SHINY_TEXTURE)) { shinytexture_ctrl->setTentative( FALSE ); shinytexture_ctrl->setEnabled( editable ); @@ -985,7 +982,7 @@ void LLPanelFace::updateUI() if (bumpytexture_ctrl && !bumpytexture_ctrl->isPickerShown()) { - if (identical_norm) + if (identical_norm && (bumpy == BUMPY_TEXTURE)) { bumpytexture_ctrl->setTentative( FALSE ); bumpytexture_ctrl->setEnabled( editable ); @@ -1633,7 +1630,7 @@ void LLPanelFace::updateUI() LLTextureCtrl* texture_ctrl = getChild("shinytexture control"); texture_ctrl->setImageAssetID(material->getSpecularID()); - if (!material->getSpecularID().isNull()) + if (!material->getSpecularID().isNull() && (shiny == SHINY_TEXTURE)) { material->getSpecularOffset(offset_x,offset_y); material->getSpecularRepeat(repeat_x,repeat_y); @@ -1652,8 +1649,9 @@ void LLPanelFace::updateUI() getChild("shinyOffsetV")->setValue(offset_y); getChild("glossiness")->setValue(material->getSpecularLightExponent()); getChild("environment")->setValue(material->getEnvironmentIntensity()); + + updateShinyControls(!material->getSpecularID().isNull(), true); } - updateShinyControls(!material->getSpecularID().isNull(), true); // Assert desired colorswatch color to match material AFTER updateShinyControls // to avoid getting overwritten with the default on some UI state changes. @@ -1680,7 +1678,7 @@ void LLPanelFace::updateUI() texture_ctrl = getChild("bumpytexture control"); texture_ctrl->setImageAssetID(material->getNormalID()); - if (!material->getNormalID().isNull()) + if (!material->getNormalID().isNull() && (bumpy == BUMPY_TEXTURE)) { material->getNormalOffset(offset_x,offset_y); material->getNormalRepeat(repeat_x,repeat_y); @@ -1697,8 +1695,9 @@ void LLPanelFace::updateUI() getChild("bumpyRot")->setValue(rot*RAD_TO_DEG); getChild("bumpyOffsetU")->setValue(offset_x); getChild("bumpyOffsetV")->setValue(offset_y); + + updateBumpyControls(!material->getNormalID().isNull(), true); } - updateBumpyControls(!material->getNormalID().isNull(), true); } else { @@ -2041,9 +2040,14 @@ void LLPanelFace::onCommitMaterialType(LLUICtrl* ctrl, void* userdata) void LLPanelFace::onCommitBump(LLUICtrl* ctrl, void* userdata) { LLPanelFace* self = (LLPanelFace*) userdata; - self->sendBump(); - self->updateBumpyControls(false, true); - self->updateMaterial(); + + LLComboBox* mComboBumpiness = self->getChild("combobox bumpiness"); + if(!mComboBumpiness) + return; + + U32 bumpiness = mComboBumpiness->getCurrentIndex(); + + self->sendBump(bumpiness); } // static @@ -2156,12 +2160,15 @@ void LLPanelFace::updateBumpyControls(bool is_setting_texture, bool mess_with_co void LLPanelFace::onCommitShiny(LLUICtrl* ctrl, void* userdata) { LLPanelFace* self = (LLPanelFace*) userdata; - self->sendShiny(); - // Need 'true' here to insure that the 'Use Texture' choice is removed - // when we select something other than a spec texture - // - self->updateShinyControls(false, true); - self->updateMaterial(); + + + LLComboBox* mComboShininess = self->getChild("combobox shininess"); + if(!mComboShininess) + return; + + U32 shininess = mComboShininess->getCurrentIndex(); + + self->sendShiny(shininess); } // static @@ -2256,41 +2263,54 @@ void LLPanelFace::onSelectTexture(const LLSD& data) void LLPanelFace::onCommitSpecularTexture( const LLSD& data ) { LL_DEBUGS("Materials") << data << LL_ENDL; - updateShinyControls(true, true); - updateMaterial(); + sendShiny(SHINY_TEXTURE); } void LLPanelFace::onCommitNormalTexture( const LLSD& data ) { LL_DEBUGS("Materials") << data << LL_ENDL; - updateBumpyControls(true, true); - updateMaterial(); + sendBump(BUMPY_TEXTURE); } void LLPanelFace::onCancelSpecularTexture(const LLSD& data) { - updateMaterial(); - updateShinyControls(false, true); + U8 shiny = 0; + struct get_shiny : public LLSelectedTEGetFunctor + { + U8 get(LLViewerObject* object, S32 face) + { + return (U8)(object->getTE(face)->getShiny()); + } + } func; + LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, shiny ); + sendShiny(shiny); } void LLPanelFace::onCancelNormalTexture(const LLSD& data) { - updateMaterial(); - updateBumpyControls(false, true); + U8 bumpy = 0; + struct get_bumpy : public LLSelectedTEGetFunctor + { + U8 get(LLViewerObject* object, S32 face) + { + return (U8)(object->getTE(face)->getBumpmap()); + } + + } func; + LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, bumpy ); + sendBump(bumpy); } void LLPanelFace::onSelectSpecularTexture(const LLSD& data) { LL_DEBUGS("Materials") << data << LL_ENDL; - updateMaterial(); - updateShinyControls(true, true); + sendShiny(SHINY_TEXTURE); } void LLPanelFace::onSelectNormalTexture(const LLSD& data) { LL_DEBUGS("Materials") << data << LL_ENDL; - updateBumpyControls(true, true); - updateMaterial(); + sendBump(BUMPY_TEXTURE); } //static diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 88f32e45f8..f64564c9a0 100755 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -63,9 +63,9 @@ protected: void sendTextureInfo(); // applies and sends texture scale, offset, etc. void sendColor(); // applies and sends color void sendAlpha(); // applies and sends transparency - void sendBump(); // applies and sends bump map + void sendBump(U32 bumpiness); // applies and sends bump map void sendTexGen(); // applies and sends bump map - void sendShiny(); // applies and sends shininess + void sendShiny(U32 shininess); // applies and sends shininess void sendFullbright(); // applies and sends full bright void sendGlow(); void sendMedia(); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index d8f1896654..0a25a57f1b 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -1980,7 +1980,7 @@ void LLVOVolume::setTEMaterialParamsCallbackTE(const LLMaterialID &pMaterialID, return; LLTextureEntry* texture_entry = getTE(te); - if (texture_entry) + if (texture_entry && (texture_entry->getMaterialID() == pMaterialID)) { setTEMaterialParams(te, pMaterialParams); } @@ -2009,7 +2009,7 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID) if (res) { #if USE_TE_SPECIFIC_REGISTRATION - LLMaterialMgr::instance().getTE(getRegion()->getRegionID(), pMaterialID, te, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2, _3)); + LLMaterialMgr::instance().getTE(getRegion()->getRegionID(), pMaterialID, te, boost::bind(&LLVOVolume::setTEMaterialParamsCallbackTE, this, _1, _2, _3)); #else LLMaterialMgr::instance().get(getRegion()->getRegionID(), pMaterialID, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2)); #endif -- cgit v1.2.3 From eaff189b45a09b4abb4bb4be15c17ff501995141 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Mon, 20 May 2013 16:38:10 -0700 Subject: Merge --- indra/newview/llpanelface.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index ff362a5c6b..d0eea6eb9b 100755 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1391,7 +1391,8 @@ void LLPanelFace::updateUI() identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &bump_func, rotation ); identical = align_planar ? identical_planar_aligned : identical; - getChild("bumpyRot")->setValue(editable ? rotation * RAD_TO_DEG : 0); + F32 normal_rot_deg = rotation * RAD_TO_DEG; + getChild("bumpyRot")->setValue(editable ? normal_rot_deg : 0.0f); getChild("bumpyRot")->setTentative(LLSD((BOOL)(!identical))); getChildView("bumpyRot")->setEnabled(editable && normmap_id.notNull()); } @@ -1835,7 +1836,8 @@ void LLPanelFace::updateMaterial() material->setNormalOffset(getChild("bumpyOffsetU")->getValue().asReal(), getChild("bumpyOffsetV")->getValue().asReal()); material->setNormalRepeat(bumpy_scale_u, bumpy_scale_v); - material->setNormalRotation(getChild("bumpyRot")->getValue().asReal()*DEG_TO_RAD); + F32 normal_rot_rads = getChild("bumpyRot")->getValue().asReal()*DEG_TO_RAD; + material->setNormalRotation(normal_rot_rads); } else { -- cgit v1.2.3 From 756c3d30eee4700c3edb1cb55c03bf5f51d648a7 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Mon, 20 May 2013 17:35:16 -0700 Subject: NORSPEC-191 make alpha masked rigged faces appear with deferred rendering on and off --- indra/newview/llvovolume.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 0a25a57f1b..caf4fe9383 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4531,7 +4531,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_GLOW); } - LLMaterial* mat = LLPipeline::sRenderDeferred ? te->getMaterialParams().get() : NULL; + LLMaterial* mat = te->getMaterialParams().get(); if (mat) { @@ -4550,6 +4550,13 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) pool->addRiggedFace(facep, LLDrawPoolAvatar::RIGGED_FULLBRIGHT); } } + else if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) + { + // This feels unclean, but is the only way to get alpha masked rigged stuff to show up + // with masking correctly in both deferred and non-deferred paths. NORSPEC-191 + // + pool->addRiggedFace(facep, LLPipeline::sRenderDeferred ? LLDrawPoolAvatar::RIGGED_MATERIAL_ALPHA_MASK : LLDrawPoolAvatar::RIGGED_ALPHA); + } else { U32 mask = mat->getShaderMask(); -- cgit v1.2.3 From 06b3879acc2f0a306cace145f3772433e5fff5c9 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Tue, 21 May 2013 15:27:52 -0700 Subject: NORSPEC-200 fix regression from 188 fix caused by not having enough bits to store SHINY_TEXTURE in the TEs bitfield --- indra/newview/llpanelface.cpp | 50 +++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index d0eea6eb9b..31e67960bd 100755 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -686,6 +686,25 @@ void LLPanelFace::updateUI() getChildView("ColorTrans")->setEnabled(editable); } + // Specular map + struct spec_get : public LLSelectedTEGetFunctor + { + LLUUID get(LLViewerObject* object, S32 te_index) + { + LLUUID id; + + LLMaterial* mat = object->getTE(te_index)->getMaterialParams().get(); + + if (mat) + { + id = mat->getSpecularID(); + } + + return id; + } + } spec_get_func; + identical_spec = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &spec_get_func, specmap_id ); + U8 shiny = 0; // Shiny @@ -701,9 +720,10 @@ void LLPanelFace::updateUI() LLCtrlSelectionInterface* combobox_shininess = childGetSelectionInterface("combobox shininess"); + if (combobox_shininess) { - combobox_shininess->selectNthItem((S32)shiny); + combobox_shininess->selectNthItem(specmap_id.isNull() ? (S32)shiny : SHINY_TEXTURE); } else { @@ -813,28 +833,6 @@ void LLPanelFace::updateUI() if (bumpy != BUMPY_TEXTURE) normmap_id = LLUUID::null; - // Specular map - struct spec_get : public LLSelectedTEGetFunctor - { - LLUUID get(LLViewerObject* object, S32 te_index) - { - LLUUID id; - - LLMaterial* mat = object->getTE(te_index)->getMaterialParams().get(); - - if (mat) - { - id = mat->getSpecularID(); - } - - return id; - } - } spec_get_func; - identical_spec = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &spec_get_func, specmap_id ); - - if (shiny != SHINY_TEXTURE) - specmap_id = LLUUID::null; - mIsAlpha = FALSE; LLGLenum image_format; struct f2 : public LLSelectedTEGetFunctor @@ -960,7 +958,9 @@ void LLPanelFace::updateUI() if (shinytexture_ctrl && !shinytexture_ctrl->isPickerShown()) { - if (identical_spec && (shiny == SHINY_TEXTURE)) + // Can't use this test as we can't actually store SHINY_TEXTURE in the TEs *sigh* + // + if (identical_spec /*&& (shiny == SHINY_TEXTURE)*/) { shinytexture_ctrl->setTentative( FALSE ); shinytexture_ctrl->setEnabled( editable ); @@ -1850,7 +1850,7 @@ void LLPanelFace::updateMaterial() LLUUID spec_map_id = getChild("shinytexture control")->getImageAssetID(); - if (!spec_map_id.isNull() && (shininess == SHINY_TEXTURE)) + if (!spec_map_id.isNull() && (shininess == SHINY_TEXTURE)) { LL_DEBUGS("Materials") << "Setting shiny texture, shininess = " << shininess << LL_ENDL; material->setSpecularID(spec_map_id); -- cgit v1.2.3 From d187ee8e59787f15b5be1b1d811e0345aa05e8bd Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Tue, 21 May 2013 16:51:36 -0700 Subject: NORSPEC-96 slight refrain, make Stretch Textures apply to norm/spec maps in planar texgen mode --- indra/newview/llselectmgr.cpp | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index e42d29f7e3..15e5f9f740 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2507,8 +2507,42 @@ void LLSelectMgr::adjustTexturesByScale(BOOL send_to_sim, BOOL stretch) // Apply new scale to face if (planar) { - object->setTEScale(te_num, 1.f/object_scale.mV[s_axis]*scale_ratio.mV[s_axis], - 1.f/object_scale.mV[t_axis]*scale_ratio.mV[t_axis]); + F32 scale_s = scale_ratio.mV[s_axis]/object_scale.mV[s_axis]; + F32 scale_t = scale_ratio.mV[t_axis]/object_scale.mV[t_axis]; + + switch (mTextureChannel) + { + case LLRender::DIFFUSE_MAP: + { + object->setTEScale(te_num, scale_s, scale_t); + } + break; + + case LLRender::NORMAL_MAP: + { + LLTextureEntry* tep = object->getTE(te_num); + if (tep && !tep->getMaterialParams().isNull()) + { + LLMaterialPtr p = tep->getMaterialParams(); + p->setNormalRepeat(scale_s * 0.5f, scale_t * 0.5f); + } + } + break; + + case LLRender::SPECULAR_MAP: + { + LLTextureEntry* tep = object->getTE(te_num); + if (tep && !tep->getMaterialParams().isNull()) + { + LLMaterialPtr p = tep->getMaterialParams(); + p->setSpecularRepeat(scale_s * 0.5f, scale_t * 0.5f); + } + } + break; + default: + break; + } + } else { -- cgit v1.2.3 From 8b7a4c503c1a64480cdd411012cae94880bf143f Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Tue, 21 May 2013 17:09:04 -0700 Subject: NORSPEC-96 tweak fix to follow clone/modify/re-apply pattern from build tool to avoid changing objects sharing a material --- indra/newview/llselectmgr.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 15e5f9f740..1bb12e495d 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2523,8 +2523,10 @@ void LLSelectMgr::adjustTexturesByScale(BOOL send_to_sim, BOOL stretch) LLTextureEntry* tep = object->getTE(te_num); if (tep && !tep->getMaterialParams().isNull()) { - LLMaterialPtr p = tep->getMaterialParams(); + LLMaterialPtr orig = tep->getMaterialParams(); + LLMaterialPtr p = new LLMaterial(orig->asLLSD()); p->setNormalRepeat(scale_s * 0.5f, scale_t * 0.5f); + selectionSetMaterial( p ); } } break; @@ -2534,8 +2536,10 @@ void LLSelectMgr::adjustTexturesByScale(BOOL send_to_sim, BOOL stretch) LLTextureEntry* tep = object->getTE(te_num); if (tep && !tep->getMaterialParams().isNull()) { - LLMaterialPtr p = tep->getMaterialParams(); + LLMaterialPtr orig = tep->getMaterialParams(); + LLMaterialPtr p = new LLMaterial(orig->asLLSD()); p->setSpecularRepeat(scale_s * 0.5f, scale_t * 0.5f); + selectionSetMaterial( p ); } } break; -- cgit v1.2.3 From 03eb406d05e6d53c202c26e564c104bcf4bef4d1 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Wed, 22 May 2013 07:06:22 -0700 Subject: NORSPEC-203 fix handling of objs with materials due to alpha mode in non-deferred --- indra/newview/llvovolume.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index caf4fe9383..ca7849fdad 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -5368,6 +5368,28 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: registerFace(group, facep, pass[mask]); } } + else if (mat) + { + if (mat->getDiffuseAlphaMode() == LLMaterial::DIFFUSE_ALPHA_MODE_MASK) + { + registerFace(group, facep, fullbright ? LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK : LLRenderPass::PASS_ALPHA_MASK); + } + else if (is_alpha || (te->getColor().mV[3] < 0.999f)) + { + registerFace(group, facep, LLRenderPass::PASS_ALPHA); + } + else if (gPipeline.canUseVertexShaders() + && LLPipeline::sRenderBump + && te->getShiny() + && can_be_shiny) + { + registerFace(group, facep, fullbright ? LLRenderPass::PASS_FULLBRIGHT_SHINY : LLRenderPass::PASS_SHINY); + } + else + { + registerFace(group, facep, fullbright ? LLRenderPass::PASS_FULLBRIGHT : LLRenderPass::PASS_SIMPLE); + } + } else if (is_alpha) { // can we safely treat this as an alpha mask? -- cgit v1.2.3