From 5c6d52f260900a483b7c9d8421ed5619b897d026 Mon Sep 17 00:00:00 2001
From: Graham Madarasz <graham@lindenlab.com>
Date: Wed, 8 May 2013 12:01:38 -0700
Subject: NORSPEC-156 modify fullbrightF colorspace conversion to eliminate
 delta with non-deferred fullbright look

---
 indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index b91aaf80fb..4dfd13d406 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -42,12 +42,9 @@ void main()
 {
 	float shadow = 1.0;
 
-	vec4 color = diffuseLookup(vary_texcoord0.xy)*vertex_color;
-	color.rgb = pow(color.rgb, vec3(2.2));
+	vec4 color = diffuseLookup(vary_texcoord0.xy)*pow(vertex_color.rgb,vec3(2.2f,2.2f,2.2f));
 	color.rgb = fullbrightAtmosTransport(color.rgb);
-
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
-
 	frag_color = color;
 }
 
-- 
cgit v1.2.3


From 8f5fc2d4c19dfaadc8113d17c219e3316e42d5bc Mon Sep 17 00:00:00 2001
From: Graham Madarasz <graham@lindenlab.com>
Date: Wed, 8 May 2013 12:14:08 -0700
Subject: NORSPEC-156 move gamma correction to vert shader

---
 indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl | 2 +-
 indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index 4dfd13d406..bb28f02aab 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -42,7 +42,7 @@ void main()
 {
 	float shadow = 1.0;
 
-	vec4 color = diffuseLookup(vary_texcoord0.xy)*pow(vertex_color.rgb,vec3(2.2f,2.2f,2.2f));
+	vec4 color = diffuseLookup(vary_texcoord0.xy)* vertex_color;
 	color.rgb = fullbrightAtmosTransport(color.rgb);
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
 	frag_color = color;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
index 2e6982d101..dd56a8c2b0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
@@ -58,7 +58,7 @@ void main()
 	
 	calcAtmospherics(pos.xyz);
 	
-	vertex_color = diffuse_color;
-
+	vertex_color.rgb = pow(diffuse_color, vec3(2.2f,2.2f,2.2f));
+	vertex_color.a   = diffuse_color.a;
 	
 }
-- 
cgit v1.2.3


From 0ee77e86deefdcee39a472b50178009a2ed99036 Mon Sep 17 00:00:00 2001
From: Graham Madarasz <graham@lindenlab.com>
Date: Tue, 7 May 2013 15:21:49 -0700
Subject: NORSPEC-147 make repeats per meter disabled when in planar mode and
 make UI reps consistent across layers

---
 indra/newview/llpanelface.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index f55d53fa29..877c7743fa 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -1537,7 +1537,7 @@ void LLPanelFace::getState()
 					{
 						enabled = (editable && ((shiny == SHINY_TEXTURE) && !specmap_id.isNull()));
 						identical = identical_spec_repeats;
-						repeats = repeats_spec * (identical_planar_texgen ? 2.0f : 1.0f);
+						repeats = repeats_spec;
 					}
 					break;
 
@@ -1545,12 +1545,12 @@ void LLPanelFace::getState()
 					{
 						enabled = (editable && ((bumpy == BUMPY_TEXTURE) && !normmap_id.isNull()));
 						identical = identical_norm_repeats;
-						repeats = repeats_norm * (identical_planar_texgen ? 2.0f : 1.0f);
+						repeats = repeats_norm;
 					}
 					break;
 				}
 
-				getChildView("rptctrl")->setEnabled(enabled);
+				getChildView("rptctrl")->setEnabled(identical_planar_texgen ? FALSE : enabled);
 				getChild<LLUICtrl>("rptctrl")->setValue(editable ? repeats : 1.0f);
 				getChild<LLUICtrl>("rptctrl")->setTentative(!identical);
 			}
@@ -1978,7 +1978,7 @@ void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata)
 	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_texture);
+	self->getChildView("rptctrl")->setVisible(true);
 
 	// Media controls
 	self->getChildView("media_info")->setVisible(show_media);
-- 
cgit v1.2.3


From 5aaab576ba42d35449ec8696d79aeb85d6d8015c Mon Sep 17 00:00:00 2001
From: Graham Madarasz <graham@lindenlab.com>
Date: Wed, 8 May 2013 12:53:47 -0700
Subject: NORSPEC-156 back to the fix that actually works

---
 indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl | 5 ++++-
 indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl | 6 ++----
 2 files changed, 6 insertions(+), 5 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index bb28f02aab..cb050c800f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -42,9 +42,12 @@ void main()
 {
 	float shadow = 1.0;
 
-	vec4 color = diffuseLookup(vary_texcoord0.xy)* vertex_color;
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * pow(vertex_color.rgb,vec3(2.2f));
+	
 	color.rgb = fullbrightAtmosTransport(color.rgb);
+
 	color.rgb = fullbrightScaleSoftClip(color.rgb);
+
 	frag_color = color;
 }
 
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
index dd56a8c2b0..3f09a15375 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
@@ -57,8 +57,6 @@ void main()
 	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
 	
 	calcAtmospherics(pos.xyz);
-	
-	vertex_color.rgb = pow(diffuse_color, vec3(2.2f,2.2f,2.2f));
-	vertex_color.a   = diffuse_color.a;
-	
+
+	vertex_color = diffuse_color;
 }
-- 
cgit v1.2.3


From ae0f362f220c54e72700b96545b9f4956ee8a113 Mon Sep 17 00:00:00 2001
From: Graham Madarasz <graham@lindenlab.com>
Date: Wed, 8 May 2013 20:00:38 -0700
Subject: Rollback NORSPEC-156 change which fails to compile due to implicit
 cast

---
 indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'indra/newview')

diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
index cb050c800f..8d76485886 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl
@@ -42,7 +42,8 @@ void main()
 {
 	float shadow = 1.0;
 
-	vec4 color = diffuseLookup(vary_texcoord0.xy) * pow(vertex_color.rgb,vec3(2.2f));
+	vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color;
+	color.rgb = pow(color.rgb,vec3(2.2f,2.2f,2.2f));
 	
 	color.rgb = fullbrightAtmosTransport(color.rgb);
 
-- 
cgit v1.2.3


From ff919a884b2c466d679164b6b7c440c2cd7581b7 Mon Sep 17 00:00:00 2001
From: Graham Madarasz <graham@lindenlab.com>
Date: Thu, 9 May 2013 14:01:31 -0700
Subject: NORSPEC-170 make adv lighting checkbox reflect whether deferred
 shaders loaded successfully

---
 indra/newview/llfloaterpreference.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index b45c944a5f..55b03986d0 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1149,7 +1149,7 @@ void LLFloaterPreference::refreshEnabledState()
 	//Deferred/SSAO/Shadows
 	LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
 	
-	BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && 
+	BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") &&
 						((bumpshiny_ctrl && bumpshiny_ctrl->get()) ? TRUE : FALSE) &&
 						shaders && 
 						gGLManager.mHasFramebufferObject &&
@@ -1163,7 +1163,9 @@ void LLFloaterPreference::refreshEnabledState()
 	LLComboBox* ctrl_shadow = getChild<LLComboBox>("ShadowDetail");
 
 	enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE);
-		
+	
+	ctrl_deferred->set(gSavedSettings.getBOOL("RenderDeferred"));
+
 	ctrl_ssao->setEnabled(enabled);
 	ctrl_dof->setEnabled(enabled);
 
-- 
cgit v1.2.3


From 76c2a85661389469df77547e1732620755a1a729 Mon Sep 17 00:00:00 2001
From: Graham Madarasz <graham@lindenlab.com>
Date: Thu, 9 May 2013 15:04:07 -0700
Subject: NORSPEC-168 separate UI handlers for spec and normal textures to
 avoid cross-talk and fix handling of bumpy/shiny menu items

---
 indra/newview/llpanelface.cpp | 90 +++++++++++++++++++++++++++----------------
 indra/newview/llpanelface.h   | 13 ++++---
 2 files changed, 64 insertions(+), 39 deletions(-)

(limited to 'indra/newview')

diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index 877c7743fa..9c40ff06cc 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -158,9 +158,9 @@ BOOL	LLPanelFace::postBuild()
 	if(mShinyTextureCtrl)
 	{
 		mShinyTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectTexture" )));
-		mShinyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitMaterialTexture, this, _2) );
-		mShinyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelMaterialTexture, this, _2) );
-		mShinyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectMaterialTexture, this, _2) );
+		mShinyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitSpecularTexture, this, _2) );
+		mShinyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelSpecularTexture, this, _2) );
+		mShinyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectSpecularTexture, this, _2) );
 		mShinyTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2));
 		mShinyTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1));
 		mShinyTextureCtrl->setFollowsTop();
@@ -173,9 +173,9 @@ BOOL	LLPanelFace::postBuild()
 	if(mBumpyTextureCtrl)
 	{
 		mBumpyTextureCtrl->setDefaultImageAssetID(LLUUID( gSavedSettings.getString( "DefaultObjectTexture" )));
-		mBumpyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitMaterialTexture, this, _2) );
-		mBumpyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelMaterialTexture, this, _2) );
-		mBumpyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectMaterialTexture, this, _2) );
+		mBumpyTextureCtrl->setCommitCallback( boost::bind(&LLPanelFace::onCommitNormalTexture, this, _2) );
+		mBumpyTextureCtrl->setOnCancelCallback( boost::bind(&LLPanelFace::onCancelNormalTexture, this, _2) );
+		mBumpyTextureCtrl->setOnSelectCallback( boost::bind(&LLPanelFace::onSelectNormalTexture, this, _2) );
 		mBumpyTextureCtrl->setDragCallback(boost::bind(&LLPanelFace::onDragTexture, this, _2));
 		mBumpyTextureCtrl->setOnTextureSelectedCallback(boost::bind(&LLPanelFace::onTextureSelectionChanged, this, _1));
 		mBumpyTextureCtrl->setFollowsTop();
@@ -303,14 +303,14 @@ void LLPanelFace::sendBump()
 		LLTextureCtrl* bumpytexture_ctrl = getChild<LLTextureCtrl>("bumpytexture control");
 		bumpytexture_ctrl->clear();
 		LLSD dummy_data;
-		onSelectMaterialTexture(dummy_data);
+		onSelectNormalTexture(dummy_data);
 	}
 	U8 bump = (U8) bumpiness & TEM_BUMP_MASK;
 	LLSelectMgr::getInstance()->selectionSetBumpmap( bump );
 
 	//refresh material state (in case this change impacts material params)
 	LLSD dummy_data;
-	onCommitMaterialTexture(dummy_data);
+	onCommitNormalTexture(dummy_data);
 }
 
 void LLPanelFace::sendTexGen()
@@ -333,6 +333,10 @@ 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);
 }
 
 void LLPanelFace::sendFullbright()
@@ -1716,7 +1720,7 @@ void LLPanelFace::onMaterialLoaded(const LLMaterialID& material_id, const LLMate
 		getChild<LLUICtrl>("glossiness")->setValue(material->getSpecularLightExponent());
 		getChild<LLUICtrl>("environment")->setValue(material->getEnvironmentIntensity());
 	}
-	updateShinyControls(combobox_shininess,this, true);
+	updateShinyControls(combobox_shininess,this, !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.
@@ -1749,7 +1753,7 @@ void LLPanelFace::onMaterialLoaded(const LLMaterialID& material_id, const LLMate
 		getChild<LLUICtrl>("bumpyOffsetU")->setValue(offset_x);
 		getChild<LLUICtrl>("bumpyOffsetV")->setValue(offset_y);
 	}
-	updateBumpyControls(combobox_bumpiness,this, true);
+	updateBumpyControls(combobox_bumpiness,this, !material->getNormalID().isNull(), true);
 }
 
 void LLPanelFace::updateMaterial()
@@ -1820,7 +1824,7 @@ void LLPanelFace::updateMaterial()
 		material_to_set->setAlphaMaskCutoff((U8)(getChild<LLUICtrl>("maskcutoff")->getValue().asInteger()));
 
 		LLUUID norm_map_id = getChild<LLTextureCtrl>("bumpytexture control")->getImageAssetID();
-		if (!norm_map_id.isNull())
+		if (!norm_map_id.isNull() && (bumpiness == BUMPY_TEXTURE))
 		{
 			LL_DEBUGS("Materials") << "Setting bumpy texture, bumpiness = " << bumpiness  << LL_ENDL;
 			material_to_set->setNormalID(norm_map_id);
@@ -1850,7 +1854,7 @@ void LLPanelFace::updateMaterial()
         
 		LLUUID spec_map_id = getChild<LLTextureCtrl>("shinytexture control")->getImageAssetID();
 
-		if (!spec_map_id.isNull())
+		if (!spec_map_id.isNull()  && (shininess == SHINY_TEXTURE))
 		{
 			LL_DEBUGS("Materials") << "Setting shiny texture, shininess = " << shininess  << LL_ENDL;
 			material_to_set->setSpecularID(spec_map_id);
@@ -2084,10 +2088,8 @@ void LLPanelFace::onCommitBump(LLUICtrl* ctrl, void* userdata)
 	self->sendBump();
 
 	LLComboBox* combo_bumpy = self->getChild<LLComboBox>("combobox bumpiness");
-	// Need 'true' here to insure that the 'Use Texture' choice is removed
-	// when we select something other than a normmap texture
-	//
-	updateBumpyControls(combo_bumpy,self, true);
+	
+	updateBumpyControls(combo_bumpy,self, false, true);
 	self->updateMaterial();
 }
 
@@ -2099,7 +2101,7 @@ void LLPanelFace::onCommitTexGen(LLUICtrl* ctrl, void* userdata)
 }
 
 // static
-void LLPanelFace::updateShinyControls(LLUICtrl* ctrl, void* userdata, bool mess_with_shiny_combobox)
+void LLPanelFace::updateShinyControls(LLUICtrl* ctrl, void* userdata, bool is_setting_texture, bool mess_with_shiny_combobox)
 {
 	LLPanelFace* self = (LLPanelFace*) userdata;
 	LLTextureCtrl* texture_ctrl = self->getChild<LLTextureCtrl>("shinytexture control");
@@ -2113,7 +2115,7 @@ void LLPanelFace::updateShinyControls(LLUICtrl* ctrl, void* userdata, bool mess_
 		{
 			return;
 		}
-		if (!shiny_texture_ID.isNull())
+		if (!shiny_texture_ID.isNull() && is_setting_texture)
 		{
 			if (!comboShiny->itemExists(USE_TEXTURE))
 			{
@@ -2124,12 +2126,12 @@ void LLPanelFace::updateShinyControls(LLUICtrl* ctrl, void* userdata, bool mess_
 				LLColorSwatchCtrl*	mShinyColorSwatch = self->getChild<LLColorSwatchCtrl>("shinycolorswatch");
 				if(mShinyColorSwatch)
 				{
-					// Doing sets in a getState func causes the 'blinking updates' of swatch colors....DON'T.
-					//
 					LL_DEBUGS("Materials") << "Resetting specular color to default of white" << LL_ENDL;
 					mShinyColorSwatch->setOriginal(LLColor4::white);
 					mShinyColorSwatch->set(LLColor4::white, TRUE);
 				}
+				self->getChild<LLUICtrl>("glossiness")->setValue(LLMaterial::DEFAULT_SPECULAR_LIGHT_EXPONENT);
+				self->getChild<LLUICtrl>("environment")->setValue(0);
 			}
 			comboShiny->setSimple(USE_TEXTURE);
 		}
@@ -2161,7 +2163,7 @@ void LLPanelFace::updateShinyControls(LLUICtrl* ctrl, void* userdata, bool mess_
 }
 
 // static
-void LLPanelFace::updateBumpyControls(LLUICtrl* ctrl, void* userdata, bool mess_with_combobox)
+void LLPanelFace::updateBumpyControls(LLUICtrl* ctrl, void* userdata, bool is_setting_texture, bool mess_with_combobox)
 {
 	LLPanelFace* self = (LLPanelFace*) userdata;
 	LLTextureCtrl* texture_ctrl = self->getChild<LLTextureCtrl>("bumpytexture control");
@@ -2175,7 +2177,11 @@ void LLPanelFace::updateBumpyControls(LLUICtrl* ctrl, void* userdata, bool mess_
 
 	if (mess_with_combobox)
 	{
-		if (!bumpy_texture_ID.isNull())
+		LLTextureCtrl* texture_ctrl = self->getChild<LLTextureCtrl>("bumpytexture control");
+		LLUUID bumpy_texture_ID = texture_ctrl->getImageAssetID();
+		LL_DEBUGS("Materials") << "texture: " << bumpy_texture_ID << (mess_with_combobox ? "" : " do not") << " update combobox" << LL_ENDL;
+
+		if (!bumpy_texture_ID.isNull() && is_setting_texture)
 		{
 			if (!comboBumpy->itemExists(USE_TEXTURE))
 			{
@@ -2204,7 +2210,7 @@ void LLPanelFace::onCommitShiny(LLUICtrl* ctrl, void* userdata)
 	// Need 'true' here to insure that the 'Use Texture' choice is removed
 	// when we select something other than a spec texture
 	//
-	updateShinyControls(combo_shiny,self, true);
+	updateShinyControls(combo_shiny,self, false, true);
 	self->updateMaterial();
 }
 
@@ -2298,34 +2304,50 @@ void LLPanelFace::onSelectTexture(const LLSD& data)
 	sendTexture();
 }
 
-void LLPanelFace::onCommitMaterialTexture( const LLSD& data )
+void LLPanelFace::onCommitSpecularTexture( const LLSD& data )
 {
 	LL_DEBUGS("Materials") << data << LL_ENDL;
-	updateMaterial();
 	LLComboBox* combo_shiny = getChild<LLComboBox>("combobox shininess");
-	updateShinyControls(combo_shiny,this, true);
+	updateShinyControls(combo_shiny,this, true, true);
+	updateMaterial();
+}
+
+void LLPanelFace::onCommitNormalTexture( const LLSD& data )
+{
+	LL_DEBUGS("Materials") << data << LL_ENDL;
 	LLComboBox* combo_bumpy = getChild<LLComboBox>("combobox bumpiness");
-	updateBumpyControls(combo_bumpy,this, true);
+	updateBumpyControls(combo_bumpy, this, true, true);
+	updateMaterial();
 }
 
-void LLPanelFace::onCancelMaterialTexture(const LLSD& data)
+void LLPanelFace::onCancelSpecularTexture(const LLSD& data)
 {
-	// not sure what to do here other than
 	updateMaterial();
 	LLComboBox* combo_shiny = getChild<LLComboBox>("combobox shininess");
-	updateShinyControls(combo_shiny,this, true);
+	updateShinyControls(combo_shiny,this, false, true);
+}
+
+void LLPanelFace::onCancelNormalTexture(const LLSD& data)
+{
+	updateMaterial();
 	LLComboBox* combo_bumpy = getChild<LLComboBox>("combobox bumpiness");
-	updateBumpyControls(combo_bumpy,this, true);
+	updateBumpyControls(combo_bumpy,this, false, true);
 }
 
-void LLPanelFace::onSelectMaterialTexture(const LLSD& data)
+void LLPanelFace::onSelectSpecularTexture(const LLSD& data)
 {
 	LL_DEBUGS("Materials") << data << LL_ENDL;
 	updateMaterial();
 	LLComboBox* combo_shiny = getChild<LLComboBox>("combobox shininess");
-	updateShinyControls(combo_shiny,this, true);
+	updateShinyControls(combo_shiny,this, true, true);
+}
+
+void LLPanelFace::onSelectNormalTexture(const LLSD& data)
+{
+	LL_DEBUGS("Materials") << data << LL_ENDL;
 	LLComboBox* combo_bumpy = getChild<LLComboBox>("combobox bumpiness");
-	updateBumpyControls(combo_bumpy,this, true);
+	updateBumpyControls(combo_bumpy,this, true, true);
+	updateMaterial();
 }
 
 //static
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index 2138319365..7fbeef223b 100644
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -76,9 +76,12 @@ protected:
 	void 	onCommitTexture(const LLSD& data);
 	void 	onCancelTexture(const LLSD& data);
 	void 	onSelectTexture(const LLSD& data);
-	void 	onCommitMaterialTexture(const LLSD& data);
-	void 	onCancelMaterialTexture(const LLSD& data);
-	void 	onSelectMaterialTexture(const LLSD& data);
+	void 	onCommitSpecularTexture(const LLSD& data);
+	void 	onCancelSpecularTexture(const LLSD& data);
+	void 	onSelectSpecularTexture(const LLSD& data);
+	void 	onCommitNormalTexture(const LLSD& data);
+	void 	onCancelNormalTexture(const LLSD& data);
+	void 	onSelectNormalTexture(const LLSD& data);
 	void 	onCommitColor(const LLSD& data);
 	void 	onCommitShinyColor(const LLSD& data);
 	void 	onCommitAlpha(const LLSD& data);
@@ -93,8 +96,8 @@ protected:
 	static void		onCommitMaterialType(		LLUICtrl* ctrl, void* userdata);
 	static void		onCommitBump(			LLUICtrl* ctrl, void* userdata);
 	static void		onCommitTexGen(			LLUICtrl* ctrl, void* userdata);
-	static void		updateShinyControls(		LLUICtrl* ctrl, void* userdata, bool mess_with_combobox = false);
-	static void		updateBumpyControls(		LLUICtrl* ctrl, void* userdata, bool mess_with_combobox = false);
+	static void		updateShinyControls(		LLUICtrl* ctrl, void* userdata, bool is_setting_texture = false, bool mess_with_combobox = false);
+	static void		updateBumpyControls(		LLUICtrl* ctrl, void* userdata, bool is_setting_texture = false, bool mess_with_combobox = false);
 	static void		onCommitShiny(			LLUICtrl* ctrl, void* userdata);
 	static void		updateAlphaControls(		LLUICtrl* ctrl, void* userdata);
 	static void		onCommitAlphaMode(		LLUICtrl* ctrl, void* userdata);
-- 
cgit v1.2.3