From 3396b728d2167c41a6ce4a6ba9dfa1fc13db2333 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Tue, 5 Mar 2019 09:35:04 -0800 Subject: Don't rebuild reflection when only edge water patches are in play. Use (Restore)TexSetup for tex binding (should be equivalent now). Simplify uniform management in alpha drawpool loop. Fix wrong modelview mat being used for distortion map gen. --- indra/newview/pipeline.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/pipeline.cpp') diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 99235509c9..89e6ddb69c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -9334,6 +9334,8 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) //disable occlusion culling for reflection map for now LLPipeline::sUseOcclusion = 0; + glh::matrix4f current = get_current_modelview(); + if (!LLViewerCamera::getInstance()->cameraUnderWater()) { //generate planar reflection map @@ -9342,8 +9344,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); - glh::matrix4f current = get_current_modelview(); - glh::matrix4f mat; camera.getOpenGLTransform(mat.m); @@ -9415,7 +9415,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) } } - LLGLUserClipPlane clip_plane(plane, mat, projection); + LLGLUserClipPlane clip_plane(plane, mReflectionModelView, projection); LLGLDisable cull(GL_CULL_FACE); updateCull(camera, mReflectedObjects, -water_clip, &plane); stateSort(camera, mReflectedObjects); @@ -9481,7 +9481,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) //clip out geometry on the same side of water as the camera w/ enough margin to not include the water geo itself, // but not so much as to clip out parts of avatars that should be seen under the water in the distortion map LLPlane plane(pnorm, -water_height * LLPipeline::sDistortionWaterClipPlaneMargin); - LLGLUserClipPlane clip_plane(plane, mReflectionModelView, projection); + LLGLUserClipPlane clip_plane(plane, current, projection); gGL.setColorMask(true, true); mWaterDis.clear(); -- cgit v1.2.3