diff options
author | Graham Linden <graham@lindenlab.com> | 2013-08-07 15:37:53 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2013-08-07 15:37:53 -0700 |
commit | e156e3ff32469d5efdfd4fb96969b8cc4bc056b8 (patch) | |
tree | 64b94c1f45002dfcf000199d3eddb9d87e3df6f7 /indra/newview/llpanelface.h | |
parent | f3952f9a8dc368c991d9aaac174bfee5a0dd90e9 (diff) |
NORSPEC-343 protect against edits that would set non-alpha faces to diffuse alpha mode blend
Diffstat (limited to 'indra/newview/llpanelface.h')
-rwxr-xr-x | indra/newview/llpanelface.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 06a45644d0..86642e5635 100755 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -258,7 +258,8 @@ private: // _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. // - U8 default_alpha_mode = object->isImageAlphaBlended(face) ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE; + bool is_alpha_face = object->isImageAlphaBlended(face); + U8 default_alpha_mode = is_alpha_face ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE; if (!current_material.isNull()) { @@ -278,6 +279,11 @@ private: LLUUID new_normal_map_id = new_material->getNormalID(); LLUUID new_spec_map_id = new_material->getSpecularID(); + if ((new_alpha_mode == LLMaterial::DIFFUSE_ALPHA_MODE_BLEND) && !is_alpha_face) + { + new_alpha_mode = LLMaterial::DIFFUSE_ALPHA_MODE_NONE; + } + bool is_default_blend_mode = (new_alpha_mode == default_alpha_mode); bool is_need_material = !is_default_blend_mode || !new_normal_map_id.isNull() || !new_spec_map_id.isNull(); |