diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-02-28 21:55:28 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-02-28 21:55:28 +0200 |
commit | 201f83472c604e837b40c12f3750602e30d79d0b (patch) | |
tree | b5e983c44eb9913c5778f0773ac986d6bf038e20 /indra/newview/llface.cpp | |
parent | 696795a368a8825fb083627e39f65dcc30266122 (diff) | |
parent | 6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff) |
Merge branch 'master' into DRTVWR-543-maint
Diffstat (limited to 'indra/newview/llface.cpp')
-rw-r--r-- | indra/newview/llface.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 4a802ad9aa..f1b64a5899 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1074,6 +1074,13 @@ bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offs F32 map_rot = 0.f, map_scaleS = 0.f, map_scaleT = 0.f, map_offsS = 0.f, map_offsT = 0.f; + LLMaterial* mat = orig_tep->getMaterialParams(); + if (!mat && map != LLRender::DIFFUSE_MAP) + { + LL_WARNS_ONCE("llface") << "Face is set to use specular or normal map but has no material, defaulting to diffuse" << LL_ENDL; + map = LLRender::DIFFUSE_MAP; + } + switch (map) { case LLRender::DIFFUSE_MAP: @@ -1084,26 +1091,26 @@ bool LLFace::calcAlignedPlanarTE(const LLFace* align_to, LLVector2* res_st_offs map_offsT = orig_tep->mOffsetT; break; case LLRender::NORMAL_MAP: - if (orig_tep->getMaterialParams()->getNormalID().isNull()) + if (mat->getNormalID().isNull()) { return false; } - map_rot = orig_tep->getMaterialParams()->getNormalRotation(); - map_scaleS = orig_tep->getMaterialParams()->getNormalRepeatX(); - map_scaleT = orig_tep->getMaterialParams()->getNormalRepeatY(); - map_offsS = orig_tep->getMaterialParams()->getNormalOffsetX(); - map_offsT = orig_tep->getMaterialParams()->getNormalOffsetY(); + map_rot = mat->getNormalRotation(); + map_scaleS = mat->getNormalRepeatX(); + map_scaleT = mat->getNormalRepeatY(); + map_offsS = mat->getNormalOffsetX(); + map_offsT = mat->getNormalOffsetY(); break; case LLRender::SPECULAR_MAP: - if (orig_tep->getMaterialParams()->getSpecularID().isNull()) + if (mat->getSpecularID().isNull()) { return false; } - map_rot = orig_tep->getMaterialParams()->getSpecularRotation(); - map_scaleS = orig_tep->getMaterialParams()->getSpecularRepeatX(); - map_scaleT = orig_tep->getMaterialParams()->getSpecularRepeatY(); - map_offsS = orig_tep->getMaterialParams()->getSpecularOffsetX(); - map_offsT = orig_tep->getMaterialParams()->getSpecularOffsetY(); + map_rot = mat->getSpecularRotation(); + map_scaleS = mat->getSpecularRepeatX(); + map_scaleT = mat->getSpecularRepeatY(); + map_offsS = mat->getSpecularOffsetX(); + map_offsT = mat->getSpecularOffsetY(); break; default: /*make compiler happy*/ break; |