diff options
author | Rider Linden <rider@lindenlab.com> | 2018-09-25 22:47:41 +0000 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-09-25 22:47:41 +0000 |
commit | cca55533f88e6e50ac006f34708b7184b6a6859c (patch) | |
tree | 54ed3a90e4ef296a8b348c5db4811b352acd6952 /indra/newview/pipeline.cpp | |
parent | 2a1a7396b22246ae526731d02a8548990187fe1b (diff) | |
parent | 3778dd40856a1a56a6ce595ae08fb7e94cabae0d (diff) |
Merged in graham_linden/viewer-eep-graham (pull request #112)
SL-9711, SL-1505, SL-9708
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r-- | indra/newview/pipeline.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 9531e0a349..a513588568 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -9820,16 +9820,20 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) //plane params LLVector3 pnorm; + F32 plane_d; + S32 water_clip = 0; if (!LLViewerCamera::getInstance()->cameraUnderWater()) { //camera is above water, clip plane points up pnorm.setVec(0,0,1); + 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); + plane_d = water_height; plane.setVec(pnorm, distance_to_water); water_clip = 1; } @@ -9862,6 +9866,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) stop_glerror(); + gGL.matrixMode(LLRender::MM_MODELVIEW); gGL.pushMatrix(); glh::matrix4f current = get_current_modelview(); @@ -9981,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); @@ -10089,7 +10095,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gPipeline.popRenderTypeMask(); LLDrawPoolWater::sNeedsReflectionUpdate = FALSE; LLDrawPoolWater::sNeedsDistortionUpdate = FALSE; - LLPlane npnorm(-pnorm, -distance_to_water); + LLPlane npnorm(-pnorm, -plane_d); LLViewerCamera::getInstance()->setUserClipPlane(npnorm); LLGLState::checkStates(); |