summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-11-12 17:34:13 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2021-11-12 17:44:40 +0200
commit7ce17542d46ff7cb6b88d33d4cad5ba4808c6c58 (patch)
treea29ce0a5bab1803b186fff9649954d68de78c7c0 /indra/newview/pipeline.cpp
parent0fa3d7705fb6a42410d1578b1fab5b7952a59e7c (diff)
DRTVWR-528 Reverting multiple commits due to moving them into D546 branch
This reverts commits 9b5b2eac82b1f423daec463b3d55d0f3d3979bbc SL-15933 53c0144dd272470172591b967a84beaa4019b728 SL-11687 492ea7c3a03d5ef0d3679b873a44c08baaced0f1 SL-16056 b854eceee3a867d64b20de18d6b7ce91b33abed0 SL-15391 921c3f5f69c90b5924d2f4bbbd32455f8c9c8173 SL-13561 639acb6ff7495a6840d437dd8473172ec03e200a SL-15333
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp39
1 files changed, 9 insertions, 30 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index c417b55108..9924b02a95 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1054,6 +1054,7 @@ void LLPipeline::updateRenderDeferred()
RenderDeferred &&
LLRenderTarget::sUseFBO &&
LLPipeline::sRenderBump &&
+ LLPipeline::sRenderTransparentWater &&
RenderAvatarVP &&
WindLightUseAtmosShaders &&
(bool) LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred");
@@ -9259,12 +9260,7 @@ inline float sgn(float a)
void LLPipeline::generateWaterReflection(LLCamera& camera_in)
{
- if (!assertInitialized())
- {
- return;
- }
-
- if (LLPipeline::sWaterReflections && LLDrawPoolWater::sNeedsReflectionUpdate)
+ if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate)
{
bool skip_avatar_update = false;
if (!isAgentAvatarValid() || gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK || !LLVOAvatar::sVisibleInFirstPerson)
@@ -9491,13 +9487,19 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
//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, camera_is_underwater ? -water_height : water_dist);
+ LLPlane plane(-pnorm, water_dist);
LLGLUserClipPlane clip_plane(plane, saved_modelview, saved_projection);
gGL.setColorMask(true, true);
mWaterDis.clear();
gGL.setColorMask(true, false);
+ // ignore clip plane if we're underwater and viewing distortion map of objects above waterline
+ if (camera_is_underwater)
+ {
+ clip_plane.disable();
+ }
+
if (reflection_detail >= WATER_REFLECT_NONE_WATER_TRANSPARENT)
{
updateCull(camera, mRefractedObjects, water_clip, &plane);
@@ -9551,29 +9553,6 @@ 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)