summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2023-01-10 11:42:12 -0600
committerDave Parks <davep@lindenlab.com>2023-01-10 11:42:12 -0600
commit4abf39c968c31a9da943a53434388102b99d487f (patch)
tree8807c96faaec13540b747497032242798837b68d /indra/newview/pipeline.cpp
parenta2d17d3c1e5a62f10ab3922b6b12f909f1cd4682 (diff)
SL-18869 Optimizations -- Bring back water plane clipping for above/below water where applicable.
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index b5271a6ca1..5e585852f4 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -2335,13 +2335,34 @@ bool LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3&
static LLTrace::BlockTimerStatHandle FTM_CULL("Object Culling");
-void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, LLPlane* planep)
+void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE; //LL_RECORD_BLOCK_TIME(FTM_CULL);
- if (planep != nullptr)
+ bool water_clip = !sRenderTransparentWater;
+
+ if (water_clip)
{
- camera.setUserClipPlane(*planep);
+
+ LLVector3 pnorm;
+
+ F32 water_height = LLEnvironment::instance().getWaterHeight();
+
+ if (sUnderWaterRender)
+ {
+ //camera is below water, cull above water
+ pnorm.setVec(0, 0, 1);
+ }
+ else
+ {
+ //camera is above water, cull below water
+ pnorm = LLVector3(0, 0, -1);
+ }
+
+ LLPlane plane;
+ plane.setVec(LLVector3(0, 0, water_height), pnorm);
+
+ camera.setUserClipPlane(plane);
}
else
{