summaryrefslogtreecommitdiff
path: root/indra/newview/llmodelpreview.cpp
diff options
context:
space:
mode:
authorPtolemy <ptolemy@lindenlab.com>2022-03-18 19:42:58 -0700
committerPtolemy <ptolemy@lindenlab.com>2022-03-18 19:54:27 -0700
commitbcd37186f18ebf5f9418fb0a54ef1cd5b6e0095f (patch)
tree674c058ea86e2d04881d99096a0d9c5fc5a7f2a9 /indra/newview/llmodelpreview.cpp
parentda6635702a7d07ddd3a45090cc74aea671c9a7c0 (diff)
SL-16993: Fix Model Upload Physics Analyze rendering physics hull as black mesh
Diffstat (limited to 'indra/newview/llmodelpreview.cpp')
-rw-r--r--indra/newview/llmodelpreview.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp
index b60fabb01b..c7f56de4ed 100644
--- a/indra/newview/llmodelpreview.cpp
+++ b/indra/newview/llmodelpreview.cpp
@@ -3285,6 +3285,14 @@ BOOL LLModelPreview::render()
if (!physics.mMesh.empty())
{ //render hull instead of mesh
+ // SL-16993 physics.mMesh[i].mNormals were being used to light the exploded
+ // analyzed physics shape but the drawArrays() interface changed
+ // causing normal data <0,0,0> to be passed to the shader.
+ // The Phyics Preview shader uses plain vertex coloring so the physics hull is full lit.
+ // We could also use interface/ui shaders.
+ gObjectPreviewProgram.unbind();
+ gPhysicsPreviewProgram.bind();
+
for (U32 i = 0; i < physics.mMesh.size(); ++i)
{
if (explode > 0.f)
@@ -3312,6 +3320,9 @@ BOOL LLModelPreview::render()
gGL.popMatrix();
}
}
+
+ gPhysicsPreviewProgram.unbind();
+ gObjectPreviewProgram.bind();
}
}
}