diff options
author | Graham Linden <graham@lindenlab.com> | 2013-08-07 13:35:08 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2013-08-07 13:35:08 -0700 |
commit | f3952f9a8dc368c991d9aaac174bfee5a0dd90e9 (patch) | |
tree | 98d8e289b73e75e73eafde30373d13120e917144 /indra/newview/llpanelface.h | |
parent | bfe2377a9a3061094e3c1fa10bb0afed06cac709 (diff) |
NORSPEC-329 fix mangling of diffuse alpha mode by material edits when only one face really has alpha
Diffstat (limited to 'indra/newview/llpanelface.h')
-rwxr-xr-x | indra/newview/llpanelface.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/indra/newview/llpanelface.h b/indra/newview/llpanelface.h index 834ad9e14c..06a45644d0 100755 --- a/indra/newview/llpanelface.h +++ b/indra/newview/llpanelface.h @@ -255,7 +255,20 @@ 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. + // + U8 default_alpha_mode = object->isImageAlphaBlended(face) ? LLMaterial::DIFFUSE_ALPHA_MODE_BLEND : LLMaterial::DIFFUSE_ALPHA_MODE_NONE; + + 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"! // |