summaryrefslogtreecommitdiff
path: root/indra/newview/llreflectionmap.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2025-03-06 15:23:54 -0500
committerGitHub <noreply@github.com>2025-03-06 15:23:54 -0500
commite6927d8a079f81522e7dde9b1c67035171f84c93 (patch)
treea5335524e579d1ad478f1b723215673a55cc51dd /indra/newview/llreflectionmap.cpp
parent5029f0322f264e17f7509952f7bf9812db17a9ec (diff)
parent42ceac9695f7e098f15264977396a939c8ddfd23 (diff)
Merge pull request #3304 from secondlife/release/2024.12-ForeverFPS
2024.12 ForeverFPS
Diffstat (limited to 'indra/newview/llreflectionmap.cpp')
-rw-r--r--indra/newview/llreflectionmap.cpp29
1 files changed, 16 insertions, 13 deletions
diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp
index f77d37f821..f3adb52d5e 100644
--- a/indra/newview/llreflectionmap.cpp
+++ b/indra/newview/llreflectionmap.cpp
@@ -65,8 +65,9 @@ void LLReflectionMap::update(U32 resolution, U32 face, bool force_dynamic, F32 n
}
F32 clip = (near_clip > 0) ? near_clip : getNearClip();
+ bool dynamic = force_dynamic || getIsDynamic();
- gViewerWindow->cubeSnapshot(LLVector3(mOrigin), mCubeArray, mCubeIndex, face, clip, getIsDynamic() || force_dynamic, useClipPlane, clipPlane);
+ gViewerWindow->cubeSnapshot(LLVector3(mOrigin), mCubeArray, mCubeIndex, face, clip, dynamic, useClipPlane, clipPlane);
}
void LLReflectionMap::autoAdjustOrigin()
@@ -185,7 +186,7 @@ void LLReflectionMap::autoAdjustOrigin()
}
}
-bool LLReflectionMap::intersects(LLReflectionMap* other)
+bool LLReflectionMap::intersects(LLReflectionMap* other) const
{
LLVector4a delta;
delta.setSub(other->mOrigin, mOrigin);
@@ -201,24 +202,24 @@ bool LLReflectionMap::intersects(LLReflectionMap* other)
extern LLControlGroup gSavedSettings;
-F32 LLReflectionMap::getAmbiance()
+F32 LLReflectionMap::getAmbiance() const
{
F32 ret = 0.f;
- if (mViewerObject && mViewerObject->getVolume())
+ if (mViewerObject && mViewerObject->getVolumeConst())
{
- ret = ((LLVOVolume*)mViewerObject)->getReflectionProbeAmbiance();
+ ret = mViewerObject->getReflectionProbeAmbiance();
}
return ret;
}
-F32 LLReflectionMap::getNearClip()
+F32 LLReflectionMap::getNearClip() const
{
const F32 MINIMUM_NEAR_CLIP = 0.1f;
F32 ret = 0.f;
- if (mViewerObject && mViewerObject->getVolume())
+ if (mViewerObject && mViewerObject->getVolumeConst())
{
ret = mViewerObject->getReflectionProbeNearClip();
}
@@ -234,11 +235,13 @@ F32 LLReflectionMap::getNearClip()
return llmax(ret, MINIMUM_NEAR_CLIP);
}
-bool LLReflectionMap::getIsDynamic()
+bool LLReflectionMap::getIsDynamic() const
{
- if (gSavedSettings.getS32("RenderReflectionProbeDetail") > (S32) LLReflectionMapManager::DetailLevel::STATIC_ONLY &&
+ static LLCachedControl<S32> detail(gSavedSettings, "RenderReflectionProbeDetail", 1);
+ if (detail() > (S32)LLReflectionMapManager::DetailLevel::STATIC_ONLY &&
mViewerObject &&
- mViewerObject->getVolume())
+ !mViewerObject->isDead() &&
+ mViewerObject->getVolumeConst())
{
return mViewerObject->getReflectionProbeIsDynamic();
}
@@ -256,7 +259,7 @@ bool LLReflectionMap::getBox(LLMatrix4& box)
glm::mat4 mv(get_current_modelview());
LLVector3 s = mViewerObject->getScale().scaledVec(LLVector3(0.5f, 0.5f, 0.5f));
mRadius = s.magVec();
- glm::mat4 scale = glm::scale(glm::make_vec3(s.mV));
+ glm::mat4 scale = glm::scale(glm::vec3(s));
if (mViewerObject->mDrawable != nullptr)
{
// object to agent space (no scale)
@@ -278,12 +281,12 @@ bool LLReflectionMap::getBox(LLMatrix4& box)
return false;
}
-bool LLReflectionMap::isActive()
+bool LLReflectionMap::isActive() const
{
return mCubeIndex != -1;
}
-bool LLReflectionMap::isRelevant()
+bool LLReflectionMap::isRelevant() const
{
static LLCachedControl<S32> RenderReflectionProbeLevel(gSavedSettings, "RenderReflectionProbeLevel", 3);