diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-02-28 21:56:33 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2022-02-28 21:56:33 +0200 |
commit | f62579f29303b33ff331f3f0b0e8d4197755d279 (patch) | |
tree | 06744ee5ccb2280970c8eed3303db326fbd5c128 /indra/newview/llface.cpp | |
parent | 611869b1035ef5677335a33169fb99413a90c3a6 (diff) | |
parent | 6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff) |
Merge branch 'master' into DRTVWR-548-maint-N
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; |