summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelface.h
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2013-09-18 18:24:16 -0700
committerGraham Linden <graham@lindenlab.com>2013-09-18 18:24:16 -0700
commit95e34d86b9d86b3b3c7d3c39620e35b06f8fa9cf (patch)
tree5a2652bef97f1bb2d76c0b86482cebe2b2505a79 /indra/newview/llpanelface.h
parent93503a05ec905ef2a8df39802fdc3475c961f3bc (diff)
parentad777b46d0fe5d790e43efb1771e9f64f3ad3dfb (diff)
The unbearable lightness of being norspec
Diffstat (limited to 'indra/newview/llpanelface.h')
-rwxr-xr-xindra/newview/llpanelface.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h
index 834ad9e14c..b684881225 100755
--- a/indra/newview/llpanelface.h
+++ b/indra/newview/llpanelface.h
@@ -255,7 +255,26 @@ private:
// Determine correct alpha mode for current diffuse texture
// (i.e. does it have an alpha channel that makes alpha mode useful)
//
- U8 default_alpha_mode = (_panel->isAlpha() ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE);
+ // _panel->isAlpha() "lies" when one face has alpha and the rest do not (NORSPEC-329)
+ // need to get per-face answer to this question for sane alpha mode retention on updates.
+ //
+ bool is_alpha_face = object->isImageAlphaBlended(face);
+
+ // need to keep this original answer for valid comparisons in logic below
+ //
+ U8 original_default_alpha_mode = is_alpha_face ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
+
+ U8 default_alpha_mode = original_default_alpha_mode;
+
+ if (!current_material.isNull())
+ {
+ default_alpha_mode = current_material->getDiffuseAlphaMode();
+ }
+
+ // Insure we don't inherit the default of blend by accident...
+ // this will be stomped by a legit request to change the alpha mode by the apply() below
+ //
+ new_material->setDiffuseAlphaMode(default_alpha_mode);
// Do "It"!
//
@@ -265,7 +284,13 @@ private:
LLUUID new_normal_map_id = new_material->getNormalID();
LLUUID new_spec_map_id = new_material->getSpecularID();
- bool is_default_blend_mode = (new_alpha_mode == default_alpha_mode);
+ if ((new_alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) && !is_alpha_face)
+ {
+ new_alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE;
+ new_material->setDiffuseAlphaMode(LLMaterial::DIFFUSE_ALPHA_MODE_NONE);
+ }
+
+ bool is_default_blend_mode = (new_alpha_mode == original_default_alpha_mode);
bool is_need_material = !is_default_blend_mode || !new_normal_map_id.isNull() || !new_spec_map_id.isNull();
if (!is_need_material)