summaryrefslogtreecommitdiff
path: root/indra/newview/llface.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-09-08 10:06:53 -0500
committerDave Parks <davep@lindenlab.com>2022-09-08 10:06:53 -0500
commit8ad7240a3bb626ebaabcc81fb8155a8cbb5adf39 (patch)
tree6830de5176cf8562b3e50a847496d8fe97bb00f1 /indra/newview/llface.cpp
parentabf788175c451046f82cc9aeaddc894c47863ffa (diff)
SL-18095 WIP -- Add Mikktspace tangent generation for PBR materials and switch to per-pixel binormal generation. Still bugged with some test content.
Diffstat (limited to 'indra/newview/llface.cpp')
-rw-r--r--indra/newview/llface.cpp11
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)
{