diff options
author | Graham Linden <graham@lindenlab.com> | 2019-01-18 13:56:12 -0800 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-01-18 13:56:12 -0800 |
commit | d070c56f640768bb73933f9cbd31bab67d26b6e9 (patch) | |
tree | e55ab4f6a104c5598523eb7c446f5e086d445fe4 /indra/newview | |
parent | 066eb59808d5649c745fdc6c37b62f2eb9a19b6f (diff) |
SL-10384
Fix issue with clip plane used in distortion map rendering including objects/avatars above water near surface.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/pipeline.cpp | 7 | ||||
-rw-r--r-- | indra/newview/pipeline.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 5d9c4d64cb..9d8f98688f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -349,6 +349,7 @@ bool LLPipeline::sMemAllocationThrottled = false; S32 LLPipeline::sVisibleLightCount = 0; F32 LLPipeline::sMinRenderSize = 0.f; bool LLPipeline::sRenderingHUDs; +F32 LLPipeline::sDistortionWaterClipPlaneMargin = 1.0001f; // EventHost API LLPipeline listener. static LLPipelineListener sPipelineListener; @@ -9649,8 +9650,10 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) if (LLPipeline::sUnderWaterRender || LLDrawPoolWater::sNeedsReflectionUpdate) { - //clip out geometry on the same side of water as the camera - LLPlane plane(pnorm, water_height); + //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); static LLCullResult result; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index c76b91266e..5be6b73cc4 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -594,6 +594,7 @@ public: static S32 sVisibleLightCount; static F32 sMinRenderSize; static bool sRenderingHUDs; + static F32 sDistortionWaterClipPlaneMargin; static LLTrace::EventStatHandle<S64> sStatBatchSize; |