From 7ef2b43802da07b8f30b455448cb84bd1c26320d Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Wed, 10 Apr 2024 15:21:59 -0700 Subject: Multiple fixes for mirrors. (#1192) * #1064 Fix for mirror surfaces going black when the roughness is set too high. * #1130 Fix for the user's avatar not appearing in mouselook in a mirror. * #1059 Disable mirrors on low settings per the feature table. * #860 Modify the settings UI to better reflect that we only have two AA modes: off and FXAA. * #1191 Add some settings for mirrors in preferences. * #1185 Add support for runtime mirror resolution changing. Useful for quality settings, and auto-FPS. --- indra/newview/llheroprobemanager.cpp | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'indra/newview/llheroprobemanager.cpp') diff --git a/indra/newview/llheroprobemanager.cpp b/indra/newview/llheroprobemanager.cpp index 13c12b5e55..dd29b416fb 100644 --- a/indra/newview/llheroprobemanager.cpp +++ b/indra/newview/llheroprobemanager.cpp @@ -64,6 +64,14 @@ LLHeroProbeManager::LLHeroProbeManager() { } +LLHeroProbeManager::~LLHeroProbeManager() +{ + cleanup(); + + mHeroVOList.clear(); + mNearestHero = nullptr; +} + // helper class to seed octree with probes void LLHeroProbeManager::update() { @@ -84,8 +92,7 @@ void LLHeroProbeManager::update() if (!mRenderTarget.isComplete()) { U32 color_fmt = GL_RGBA16F; - U32 targetRes = mProbeResolution; // super sample - mRenderTarget.allocate(targetRes, targetRes, color_fmt, true); + mRenderTarget.allocate(mProbeResolution, mProbeResolution, color_fmt, true); } if (mMipChain.empty()) @@ -472,12 +479,19 @@ void LLHeroProbeManager::renderDebug() gDebugProgram.unbind(); } + void LLHeroProbeManager::initReflectionMaps() { U32 count = LL_MAX_HERO_PROBE_COUNT; - if (mTexture.isNull() || mReflectionProbeCount != count || mReset) + if ((mTexture.isNull() || mReflectionProbeCount != count || mReset) && LLPipeline::RenderMirrors) { + + if (mReset) + { + cleanup(); + } + mReset = false; mReflectionProbeCount = count; mProbeResolution = gSavedSettings.getS32("RenderHeroProbeResolution"); @@ -546,9 +560,8 @@ void LLHeroProbeManager::cleanup() mDefaultProbe = nullptr; mUpdatingProbe = nullptr; - - mHeroVOList.clear(); - mNearestHero = nullptr; + /* + */ } void LLHeroProbeManager::doOcclusion() @@ -565,6 +578,11 @@ void LLHeroProbeManager::doOcclusion() } } +void LLHeroProbeManager::reset() +{ + mReset = true; +} + bool LLHeroProbeManager::registerViewerObject(LLVOVolume* drawablep) { llassert(drawablep != nullptr); -- cgit v1.3