diff options
author | Graham Madarasz <graham@lindenlab.com> | 2013-05-21 16:51:36 -0700 |
---|---|---|
committer | Graham Madarasz <graham@lindenlab.com> | 2013-05-21 16:51:36 -0700 |
commit | d187ee8e59787f15b5be1b1d811e0345aa05e8bd (patch) | |
tree | d09af2a43139b7ac97d63e85b179ac0924f8fac9 /indra/newview | |
parent | e2ca8412e48152f563df5d1fa8862e5ada738393 (diff) |
NORSPEC-96 slight refrain, make Stretch Textures apply to norm/spec maps in planar texgen mode
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llselectmgr.cpp | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index e42d29f7e3..15e5f9f740 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2507,8 +2507,42 @@ void LLSelectMgr::adjustTexturesByScale(BOOL send_to_sim, BOOL stretch) // Apply new scale to face if (planar) { - object->setTEScale(te_num, 1.f/object_scale.mV[s_axis]*scale_ratio.mV[s_axis], - 1.f/object_scale.mV[t_axis]*scale_ratio.mV[t_axis]); + F32 scale_s = scale_ratio.mV[s_axis]/object_scale.mV[s_axis]; + F32 scale_t = scale_ratio.mV[t_axis]/object_scale.mV[t_axis]; + + switch (mTextureChannel) + { + case LLRender::DIFFUSE_MAP: + { + object->setTEScale(te_num, scale_s, scale_t); + } + break; + + case LLRender::NORMAL_MAP: + { + LLTextureEntry* tep = object->getTE(te_num); + if (tep && !tep->getMaterialParams().isNull()) + { + LLMaterialPtr p = tep->getMaterialParams(); + p->setNormalRepeat(scale_s * 0.5f, scale_t * 0.5f); + } + } + break; + + case LLRender::SPECULAR_MAP: + { + LLTextureEntry* tep = object->getTE(te_num); + if (tep && !tep->getMaterialParams().isNull()) + { + LLMaterialPtr p = tep->getMaterialParams(); + p->setSpecularRepeat(scale_s * 0.5f, scale_t * 0.5f); + } + } + break; + default: + break; + } + } else { |