summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2018-09-25 22:20:07 +0100
committerGraham Linden <graham@lindenlab.com>2018-09-25 22:20:07 +0100
commit3778dd40856a1a56a6ce595ae08fb7e94cabae0d (patch)
treeeb71735e3a967e06768ce61c672b99d5af33e075 /indra/newview
parent5969609c4703cd21e431e05bcb0c48fc241faf11 (diff)
SL-1505 and SL-9608
Get both reflections and clip plane bugs fixed (at the same damn time).
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/lldrawpoolwater.cpp2
-rw-r--r--indra/newview/pipeline.cpp15
2 files changed, 8 insertions, 9 deletions
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index 56f3b75792..7a25e62651 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -721,7 +721,7 @@ void LLDrawPoolWater::shade()
// using squash clip for deferred rendering makes the horizon lines match
// between ALM and non-ALM rendering (SL-1655), but introduces an ugly seem between
// near and far water(SL-9696)...we're going to live with the former and not cause the latter
- else if (gGLManager.mHasDepthClamp || deferred_render)
+ else if (gGLManager.mHasDepthClamp || deferred_render)
{
face->renderIndexed();
}
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index cafa49a229..a513588568 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -9818,25 +9818,22 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
camera.setOriginAndLookAt(reflect_origin, LLVector3::z_axis, reflect_interest_point);
- F32 to_clip = fabsf(camera_height-water_height);
- F32 pad = -to_clip*0.05f; //amount to "pad" clip plane by
-
//plane params
LLVector3 pnorm;
- F32 pd;
+ F32 plane_d;
S32 water_clip = 0;
if (!LLViewerCamera::getInstance()->cameraUnderWater())
{ //camera is above water, clip plane points up
pnorm.setVec(0,0,1);
- pd = -water_height;
+ plane_d = -water_height;
plane.setVec(pnorm, -distance_to_water);
water_clip = -1;
}
else
{ //camera is below water, clip plane points down
pnorm = LLVector3(0,0,-1);
- pd = water_height;
+ plane_d = water_height;
plane.setVec(pnorm, distance_to_water);
water_clip = 1;
}
@@ -9869,6 +9866,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
stop_glerror();
+ gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.pushMatrix();
glh::matrix4f current = get_current_modelview();
@@ -9988,6 +9986,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
LLPipeline::sRenderingWaterReflection = false;
glCullFace(GL_BACK);
+ gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.popMatrix();
mWaterRef.flush();
set_current_modelview(current);
@@ -10031,7 +10030,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
{
//clip out geometry on the same side of water as the camera
mat = get_current_modelview();
- LLPlane plane(-pnorm, -(pd+pad));
+ LLPlane plane(-pnorm, -distance_to_water);
LLGLUserClipPlane clip_plane(plane, mat, projection);
static LLCullResult result;
@@ -10096,7 +10095,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
gPipeline.popRenderTypeMask();
LLDrawPoolWater::sNeedsReflectionUpdate = FALSE;
LLDrawPoolWater::sNeedsDistortionUpdate = FALSE;
- LLPlane npnorm(-pnorm, -pd);
+ LLPlane npnorm(-pnorm, -plane_d);
LLViewerCamera::getInstance()->setUserClipPlane(npnorm);
LLGLState::checkStates();