summaryrefslogtreecommitdiff
path: root/indra/newview/llheroprobemanager.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2024-02-25 23:38:11 -0800
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2024-02-25 23:38:11 -0800
commit2ba5449b8b888b64ed87ef801426f7eab6e0be95 (patch)
treed5e0cddaadb00fa1a47c380e7b577feb5c69f7b1 /indra/newview/llheroprobemanager.cpp
parent320258729757e9ef14e9509c22eca1ce6a0da856 (diff)
#889 Start removing mDrawable references. These may be null.
Diffstat (limited to 'indra/newview/llheroprobemanager.cpp')
-rw-r--r--indra/newview/llheroprobemanager.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp
index f350b28bf5..feb81394cf 100644
--- a/indra/newview/llheroprobemanager.cpp
+++ b/indra/newview/llheroprobemanager.cpp
@@ -116,18 +116,11 @@ void LLHeroProbeManager::update()
{
if (vo && (!vo->isDead() || vo != nullptr))
{
- if (vo->mDrawable.notNull())
+ float distance = (LLViewerCamera::instance().getOrigin() - vo->getPositionAgent()).magVec();
+ if (distance < last_distance)
{
- if (vo->mDrawable->mDistanceWRTCamera < last_distance)
- {
- mNearestHero = vo;
- last_distance = vo->mDrawable->mDistanceWRTCamera;
- }
- }
- else
- {
- // Valid drawables only please. Unregister this one.
- unregisterViewerObject(vo);
+ mNearestHero = vo;
+ last_distance = distance;
}
}
else
@@ -136,12 +129,12 @@ void LLHeroProbeManager::update()
}
}
- if (mNearestHero != nullptr && !mNearestHero->isDead() && mNearestHero->mDrawable.notNull())
+ if (mNearestHero != nullptr && !mNearestHero->isDead())
{
LLVector3 hero_pos = mNearestHero->getPositionAgent();
LLVector3 face_normal = LLVector3(0, 0, 1);
- face_normal *= mNearestHero->mDrawable->getXform()->getWorldRotation();
+ face_normal *= mNearestHero->getWorldRotation();
face_normal.normalize();
LLVector3 offset = camera_pos - hero_pos;
@@ -210,7 +203,8 @@ void LLHeroProbeManager::update()
}
else
{
- if (mLowPriorityFaceThrottle > 0 && mCurrentProbeUpdateFrame % mLowPriorityFaceThrottle == 0) {
+ if (mLowPriorityFaceThrottle > 0 && mCurrentProbeUpdateFrame % mLowPriorityFaceThrottle == 0)
+ {
updateProbeFace(mProbes[j], i, near_clip);
mCurrentProbeUpdateFrame = 0;
}
@@ -352,6 +346,9 @@ void LLHeroProbeManager::updateProbeFace(LLReflectionMap* probe, U32 face, F32 n
}
}
+// Separate out radiance generation as a separate stage.
+// This is to better enable independent control over how we generate radiance vs. having it coupled with processing the final face of the probe.
+// Useful when we may not always be rendering a full set of faces of the probe.
void LLHeroProbeManager::generateRadiance(LLReflectionMap* probe)
{
S32 sourceIdx = mReflectionProbeCount;