summaryrefslogtreecommitdiff
path: root/indra/newview/llsettingsvo.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-01-09 10:14:41 +0800
committerErik Kundiman <erik@megapahit.org>2024-01-09 10:14:41 +0800
commitf6dec0bf7b9baa990fa26398e77faf5a410b8be6 (patch)
tree9ed732e6801157018faff52d4782c2688fefdd73 /indra/newview/llsettingsvo.cpp
parent0fd4a8b59677e1a85d19308379ab9967345749dc (diff)
parent3c858d7e2d6633df14df473a918d2fb848403972 (diff)
Merge tag '7.1.2-release'
source for viewer 7.1.2.7215179142
Diffstat (limited to 'indra/newview/llsettingsvo.cpp')
-rw-r--r--indra/newview/llsettingsvo.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 42587658a6..7009fb98ab 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -63,6 +63,7 @@
#include <boost/algorithm/string/replace.hpp>
#include "llinventoryobserver.h"
#include "llinventorydefines.h"
+#include "llworld.h"
#include "lltrans.h"
@@ -983,12 +984,21 @@ void LLSettingsVOWater::applySpecial(void *ptarget, bool force)
LLEnvironment& env = LLEnvironment::instance();
- auto group = LLGLSLShader::SG_WATER;
+ auto group = LLGLSLShader::SG_ANY;
LLShaderUniforms* shader = &((LLShaderUniforms*)ptarget)[group];
{
F32 water_height = env.getWaterHeight();
+ if (LLViewerCamera::instance().cameraUnderWater())
+ { // when the camera is under water, use the water height at the camera position
+ LLViewerRegion* region = LLWorld::instance().getRegionFromPosAgent(LLViewerCamera::instance().getOrigin());
+ if (region)
+ {
+ water_height = region->getWaterHeight();
+ }
+ }
+
//transform water plane to eye space
glh::vec3f norm(0.f, 0.f, 1.f);
glh::vec3f p(0.f, 0.f, water_height);