summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-09-17 15:48:57 +0300
committerNat Goodspeed <nat@lindenlab.com>2021-11-19 14:43:19 -0500
commit80ac5d49d950a773768550070dd272a58c95c245 (patch)
tree3bc4239b839903418700b05b7fed7ebe79316a85 /indra
parent7f2e740591ed7afa5b8da620802dbdca40da7f4c (diff)
SL-13561 When ALM is enabled, disabling water rendering breaks the sky
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/pipeline.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 71a438302a..e23aeb286c 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -9203,7 +9203,13 @@ inline float sgn(float a)
void LLPipeline::generateWaterReflection(LLCamera& camera_in)
{
LL_PROFILE_ZONE_SCOPED;
- if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate)
+
+ if (!assertInitialized())
+ {
+ return;
+ }
+
+ if (LLPipeline::sWaterReflections && LLDrawPoolWater::sNeedsReflectionUpdate)
{
bool skip_avatar_update = false;
if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson)
@@ -9488,6 +9494,29 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
}
+ else
+ {
+ // Initial sky pass is still needed even if water reflection is not rendering
+ bool camera_is_underwater = LLViewerCamera::getInstance()->cameraUnderWater();
+ if (!camera_is_underwater)
+ {
+ gPipeline.pushRenderTypeMask();
+ {
+ gPipeline.andRenderTypeMask(
+ LLPipeline::RENDER_TYPE_SKY,
+ LLPipeline::RENDER_TYPE_WL_SKY,
+ LLPipeline::END_RENDER_TYPES);
+
+ LLCamera camera = camera_in;
+ camera.setFar(camera_in.getFar() * 0.75f);
+
+ updateCull(camera, mSky);
+ stateSort(camera, mSky);
+ renderGeom(camera, TRUE);
+ }
+ gPipeline.popRenderTypeMask();
+ }
+ }
}
glh::matrix4f look(const LLVector3 pos, const LLVector3 dir, const LLVector3 up)