summaryrefslogtreecommitdiff
path: root/indra/newview/llreflectionmap.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-01-20 16:00:28 +0800
committerErik Kundiman <erik@megapahit.org>2025-01-20 16:00:28 +0800
commitad3694fd4b6bfaf5621a12eb4536a1eb6a10f8f2 (patch)
treebc343dc4a0f8a469ecab34e64b5c5dfe76ea1297 /indra/newview/llreflectionmap.cpp
parent45249de1ca418324c4077312eefc7edc7e22c401 (diff)
parent306e9e6d0293ed6470db19c0882930fff0cd145f (diff)
Merge remote-tracking branch 'secondlife/release/2024.12-ForeverFPS' into 2024.12-ForeverFPS
Diffstat (limited to 'indra/newview/llreflectionmap.cpp')
-rw-r--r--indra/newview/llreflectionmap.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/indra/newview/llreflectionmap.cpp b/indra/newview/llreflectionmap.cpp
index f77d37f821..1196d138e9 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();
}
@@ -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);