diff options
Diffstat (limited to 'indra/newview/llface.cpp')
-rw-r--r-- | indra/newview/llface.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 52aacb607c..f35b4b6d91 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -2166,14 +2166,19 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, mVertexBuffer->getTangentStrider(tangent, mGeomIndex, mGeomCount, map_range); F32* tangents = (F32*) tangent.get(); - mVObjp->getVolume()->genTangents(f); + LLGLTFMaterial* gltf_mat = tep->getGLTFMaterial(); + static LLCachedControl<bool> use_mikktspace(gSavedSettings, "RenderUseMikktSpace"); + bool mikktspace = use_mikktspace && gltf_mat != nullptr; + + mVObjp->getVolume()->genTangents(f, mikktspace); LLVector4Logical mask; mask.clear(); mask.setElement<3>(); - LLVector4a* src = vf.mTangents; - LLVector4a* end = vf.mTangents+num_vertices; + LLVector4a* tbuff = mikktspace ? vf.mMikktSpaceTangents : vf.mTangents; + LLVector4a* src = tbuff; + LLVector4a* end = tbuff+num_vertices; while (src < end) { |