From 8b747cee182cd8e95063fa152d9b5d7383cb1c74 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Mon, 6 May 2024 16:49:24 -0500 Subject: BOOL to bool --- indra/newview/llheroprobemanager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llheroprobemanager.cpp') diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index dd29b416fb..cd7ee4736a 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -42,8 +42,8 @@ #include "llviewerjoystick.h" #include "llviewermediafocus.h" -extern BOOL gCubeSnapshot; -extern BOOL gTeleportDisplay; +extern bool gCubeSnapshot; +extern bool gTeleportDisplay; // get the next highest power of two of v (or v if v is already a power of two) //defined in llvertexbuffer.cpp -- cgit v1.2.3 From a7b0f9391146b42dd5cd5f47f845de81bfdb6820 Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Tue, 11 Jun 2024 15:39:48 -0700 Subject: Fixed signed/unsigned warnings after they got enabled in the maint-A merge --- indra/newview/llheroprobemanager.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra/newview/llheroprobemanager.cpp') diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index 83c7b8a354..f544b70329 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -101,7 +101,7 @@ void LLHeroProbeManager::update() U32 count = log2((F32)res) + 0.5f; mMipChain.resize(count); - for (int i = 0; i < count; ++i) + for (U32 i = 0; i < count; ++i) { mMipChain[i].allocate(res, res, GL_RGBA16F); res /= 2; @@ -198,7 +198,7 @@ void LLHeroProbeManager::update() mFaceUpdateList[i] = ceilf(cube_facing * gPipeline.RenderHeroProbeConservativeUpdateMultiplier); } - + mProbes[0]->mOrigin = probe_pos; } else @@ -359,7 +359,8 @@ void LLHeroProbeManager::updateProbeFace(LLReflectionMap* probe, U32 face, bool res /= 2; - S32 mip = i - (mMipChain.size() - mips); + llassert(mMipChain.size() <= size_t(S32_MAX)); + GLint mip = i - (S32(mMipChain.size()) - mips); if (mip >= 0) { @@ -487,7 +488,8 @@ void LLHeroProbeManager::updateUniforms() mHeroData.heroSphere.mV[3] = mProbes[0]->mRadius; } - mHeroData.heroMipCount = mMipChain.size(); + llassert(mMipChain.size() <= size_t(S32_MAX)); + mHeroData.heroMipCount = S32(mMipChain.size()); } void LLHeroProbeManager::renderDebug() -- cgit v1.2.3 From 80ea30af1a8b38360f71c29cc45872c4399dab0d Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 21 Jun 2024 13:13:08 -0500 Subject: #1769 gltf optimization pass (#1816) #1814 and #1517 Fix mirror update rate and occlusion culling --- indra/newview/llheroprobemanager.cpp | 50 ++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 22 deletions(-) (limited to 'indra/newview/llheroprobemanager.cpp') diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index f544b70329..66ccdd2b32 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -188,18 +188,8 @@ void LLHeroProbeManager::update() LLVector3(0, 0, -1) }; - // 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])); - - cube_facing = 1 - cube_facing; - - mFaceUpdateList[i] = ceilf(cube_facing * gPipeline.RenderHeroProbeConservativeUpdateMultiplier); - } - - mProbes[0]->mOrigin = probe_pos; + mProbes[0]->mRadius = mNearestHero->getScale().magVec() * 0.5f; } else { @@ -220,9 +210,10 @@ void LLHeroProbeManager::renderProbes() static LLCachedControl sDetail(gSavedSettings, "RenderHeroReflectionProbeDetail", -1); static LLCachedControl sLevel(gSavedSettings, "RenderHeroReflectionProbeLevel", 3); + static LLCachedControl sUpdateRate(gSavedSettings, "RenderHeroProbeUpdateRate", 0); F32 near_clip = 0.01f; - if (mNearestHero != nullptr && (gPipeline.RenderHeroProbeUpdateRate == 0 || (gFrameCount % gPipeline.RenderHeroProbeUpdateRate) == 0) && + if (mNearestHero != nullptr && !gTeleportDisplay && !gDisconnected && !LLAppViewer::instance()->logoutRequestSent()) { LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("hpmu - realtime"); @@ -232,20 +223,36 @@ void LLHeroProbeManager::renderProbes() gPipeline.mReflectionMapManager.mRadiancePass = true; mRenderingMirror = true; - doOcclusion(); + S32 rate = sUpdateRate; - for (U32 j = 0; j < mProbes.size(); j++) + // rate must be divisor of 6 (1, 2, 3, or 6) + if (rate < 1) + { + rate = 1; + } + else if (rate > 3) { + rate = 6; + } + + S32 face = gFrameCount % 6; + + if (!mProbes.empty() && !mProbes[0].isNull() && !mProbes[0]->mOccluded) + { + LL_PROFILE_ZONE_NUM(gFrameCount % rate); + LL_PROFILE_ZONE_NUM(rate); + for (U32 i = 0; i < 6; ++i) { - if (mFaceUpdateList[i] > 0 && mCurrentProbeUpdateFrame % mFaceUpdateList[i] == 0) - { - updateProbeFace(mProbes[j], i, mNearestHero->getReflectionProbeIsDynamic() && sDetail > 0, near_clip); - mCurrentProbeUpdateFrame = 0; + if ((gFrameCount % rate) == (i % rate)) + { // update 6/rate faces per frame + LL_PROFILE_ZONE_NUM(i); + updateProbeFace(mProbes[0], i, mNearestHero->getReflectionProbeIsDynamic() && sDetail > 0, near_clip); } } - generateRadiance(mProbes[j]); + generateRadiance(mProbes[0]); } + mRenderingMirror = false; gPipeline.mReflectionMapManager.mRadiancePass = radiance_pass; @@ -253,8 +260,6 @@ void LLHeroProbeManager::renderProbes() mProbes[0]->mViewerObject = mNearestHero; mProbes[0]->autoAdjustOrigin(); } - - mCurrentProbeUpdateFrame++; } // Do the reflection map update render passes. @@ -388,6 +393,7 @@ void LLHeroProbeManager::updateProbeFace(LLReflectionMap* probe, U32 face, bool // Useful when we may not always be rendering a full set of faces of the probe. void LLHeroProbeManager::generateRadiance(LLReflectionMap* probe) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; S32 sourceIdx = mReflectionProbeCount; // Unlike the reflectionmap manager, all probes are considered "realtime" for hero probes. @@ -594,7 +600,7 @@ void LLHeroProbeManager::doOcclusion() for (auto& probe : mProbes) { - if (probe != nullptr && probe != mDefaultProbe) + if (probe != nullptr) { probe->doOcclusion(eye); } -- cgit v1.2.3