summaryrefslogtreecommitdiff
path: root/indra/newview/llheroprobemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llheroprobemanager.cpp')
-rw-r--r--indra/newview/llheroprobemanager.cpp40
1 files changed, 18 insertions, 22 deletions
diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp
index f3b4d939aa..83c7b8a354 100644
--- a/indra/newview/llheroprobemanager.cpp
+++ b/indra/newview/llheroprobemanager.cpp
@@ -75,7 +75,7 @@ LLHeroProbeManager::~LLHeroProbeManager()
// helper class to seed octree with probes
void LLHeroProbeManager::update()
{
- if (!LLPipeline::RenderMirrors || gTeleportDisplay || LLStartUp::getStartupState() < STATE_PRECACHE)
+ if (!LLPipeline::RenderMirrors || !LLPipeline::sReflectionProbesEnabled || gTeleportDisplay || LLStartUp::getStartupState() < STATE_PRECACHE)
{
return;
}
@@ -112,7 +112,6 @@ void LLHeroProbeManager::update()
LLVector4a probe_pos;
LLVector3 camera_pos = LLViewerCamera::instance().mOrigin;
- F32 near_clip = 0.1f;
bool probe_present = false;
LLQuaternion cameraOrientation = LLViewerCamera::instance().getQuaternion();
LLVector3 cameraDirection = LLVector3::z_axis * cameraOrientation;
@@ -124,7 +123,7 @@ void LLHeroProbeManager::update()
float camera_center_distance = 99999.f;
for (auto vo : mHeroVOList)
{
- if (vo && !vo->isDead() && vo->mDrawable.notNull())
+ if (vo && !vo->isDead() && vo->mDrawable.notNull() && vo->isReflectionProbe() && vo->getReflectionProbeIsBox())
{
float distance = (LLViewerCamera::instance().getOrigin() - vo->getPositionAgent()).magVec();
float center_distance = cameraDirection * (vo->getPositionAgent() - camera_pos);
@@ -192,20 +191,15 @@ void LLHeroProbeManager::update()
// Iterate through each face of the cube
for (int i = 0; i < 6; i++)
{
- float cube_facing = fmax(-1, fmin(1.0f, cameraDirection * cubeFaces[i])) * 0.6 + 0.4;
+ float cube_facing = fmax(-1, fmin(1.0f, cameraDirection * cubeFaces[i]));
- float updateRate;
- if (cube_facing < 0.1f)
- {
- updateRate = 0;
- }
- else
- {
- updateRate = ceilf(cube_facing * gPipeline.RenderHeroProbeConservativeUpdateMultiplier);
+ cube_facing = 1 - cube_facing;
+
+ mFaceUpdateList[i] = ceilf(cube_facing * gPipeline.RenderHeroProbeConservativeUpdateMultiplier);
}
- mFaceUpdateList[i] = updateRate;
- }
+
+ mProbes[0]->mOrigin = probe_pos;
}
else
{
@@ -214,20 +208,24 @@ void LLHeroProbeManager::update()
mHeroProbeStrength = 1;
}
- else
- {
- probe_pos.load3(camera_pos.mV);
}
+void LLHeroProbeManager::renderProbes()
+{
+ if (!LLPipeline::RenderMirrors || !LLPipeline::sReflectionProbesEnabled || gTeleportDisplay ||
+ LLStartUp::getStartupState() < STATE_PRECACHE)
+ {
+ return;
+ }
static LLCachedControl<S32> sDetail(gSavedSettings, "RenderHeroReflectionProbeDetail", -1);
static LLCachedControl<S32> sLevel(gSavedSettings, "RenderHeroReflectionProbeLevel", 3);
- if (mNearestHero != nullptr)
+ F32 near_clip = 0.01f;
+ if (mNearestHero != nullptr && (gPipeline.RenderHeroProbeUpdateRate == 0 || (gFrameCount % gPipeline.RenderHeroProbeUpdateRate) == 0) &&
+ !gTeleportDisplay && !gDisconnected && !LLAppViewer::instance()->logoutRequestSent())
{
LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("hpmu - realtime");
- // Probe 0 is always our mirror probe.
- mProbes[0]->mOrigin = probe_pos;
bool radiance_pass = gPipeline.mReflectionMapManager.isRadiancePass();
@@ -585,8 +583,6 @@ void LLHeroProbeManager::cleanup()
mDefaultProbe = nullptr;
mUpdatingProbe = nullptr;
- /*
- */
}
void LLHeroProbeManager::doOcclusion()