From bcd37186f18ebf5f9418fb0a54ef1cd5b6e0095f Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Fri, 18 Mar 2022 19:42:58 -0700 Subject: SL-16993: Fix Model Upload Physics Analyze rendering physics hull as black mesh --- indra/newview/llmodelpreview.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview/llmodelpreview.cpp') 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(); } } } -- cgit v1.2.3