summaryrefslogtreecommitdiff
path: root/indra/newview/llviewercamera.cpp
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-11-16 16:46:12 -0600
committerRunitaiLinden <davep@lindenlab.com>2023-11-16 16:46:12 -0600
commitbdb53fd56d56c659941e7e63f83cefc366acef6d (patch)
tree89a6744852e7df622df02477a54c977aa91783d7 /indra/newview/llviewercamera.cpp
parent361efcb9267f2c91f88198081bbe6ac2264766fd (diff)
SL-20611 Make haze effect local lights -- move sky and water haze to their own passes and unify sky and water haze in forward rendering shaders.
Diffstat (limited to 'indra/newview/llviewercamera.cpp')
-rw-r--r--indra/newview/llviewercamera.cpp59
1 files changed, 31 insertions, 28 deletions
diff --git a/indra/newview/llviewercamera.cpp b/indra/newview/llviewercamera.cpp
index b37f08283d..b926631ebe 100644
--- a/indra/newview/llviewercamera.cpp
+++ b/indra/newview/llviewercamera.cpp
@@ -50,6 +50,7 @@
#include "llquaternion.h"
#include "llwindow.h" // getPixelAspectRatio()
#include "lltracerecording.h"
+#include "llenvironment.h"
// System includes
#include <iomanip> // for setprecision
@@ -96,35 +97,37 @@ LLViewerCamera::LLViewerCamera() : LLCamera()
gSavedSettings.getControl("CameraAngle")->getCommitSignal()->connect(boost::bind(&LLViewerCamera::updateCameraAngle, this, _2));
}
-void LLViewerCamera::updateCameraLocation(const LLVector3 &center,
- const LLVector3 &up_direction,
- const LLVector3 &point_of_interest)
+void LLViewerCamera::updateCameraLocation(const LLVector3 &center, const LLVector3 &up_direction, const LLVector3 &point_of_interest)
{
- // do not update if avatar didn't move
- if (!LLViewerJoystick::getInstance()->getCameraNeedsUpdate())
- {
- return;
- }
-
- LLVector3 last_position;
- LLVector3 last_axis;
- last_position = getOrigin();
- last_axis = getAtAxis();
-
- mLastPointOfInterest = point_of_interest;
-
- LLViewerRegion * regp = gAgent.getRegion();
- F32 water_height = (NULL != regp) ? regp->getWaterHeight() : 0.f;
-
- LLVector3 origin = center;
- if (origin.mV[2] > water_height)
- {
- origin.mV[2] = llmax(origin.mV[2], water_height+0.20f);
- }
- else
- {
- origin.mV[2] = llmin(origin.mV[2], water_height-0.20f);
- }
+ // do not update if avatar didn't move
+ if (!LLViewerJoystick::getInstance()->getCameraNeedsUpdate())
+ {
+ return;
+ }
+
+ LLVector3 last_position;
+ LLVector3 last_axis;
+ last_position = getOrigin();
+ last_axis = getAtAxis();
+
+ mLastPointOfInterest = point_of_interest;
+
+ LLViewerRegion *regp = gAgent.getRegion();
+ F32 water_height = (NULL != regp) ? regp->getWaterHeight() : 0.f;
+
+ LLVector3 origin = center;
+
+ if (LLEnvironment::instance().getCurrentWater()->getFogMod() != 1.f)
+ {
+ if (origin.mV[2] > water_height)
+ {
+ origin.mV[2] = llmax(origin.mV[2], water_height + 0.20f);
+ }
+ else
+ {
+ origin.mV[2] = llmin(origin.mV[2], water_height - 0.20f);
+ }
+ }
setOriginAndLookAt(origin, up_direction, point_of_interest);