summaryrefslogtreecommitdiff
path: root/indra/newview/llreflectionmapmanager.cpp
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2023-11-13 17:26:14 -0800
committerCosmic Linden <cosmic@lindenlab.com>2024-01-19 15:43:13 -0800
commit2f18d74f9ab3165da680ce2ee2f0c455ce7e0796 (patch)
treeeb5e264b470ebd6113db0965e09eddb95de9adb4 /indra/newview/llreflectionmapmanager.cpp
parentc2a30057f8c8dde913d12c0ee21d98191f58c5f1 (diff)
SL-20606: Full GLTF material preview. Works for most materials.
Diffstat (limited to 'indra/newview/llreflectionmapmanager.cpp')
-rw-r--r--indra/newview/llreflectionmapmanager.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp
index 69674417c1..84f6dd7a4f 100644
--- a/indra/newview/llreflectionmapmanager.cpp
+++ b/indra/newview/llreflectionmapmanager.cpp
@@ -27,6 +27,9 @@
#include "llviewerprecompiledheaders.h"
#include "llreflectionmapmanager.h"
+
+#include <bitset>
+
#include "llviewercamera.h"
#include "llspatialpartition.h"
#include "llviewerregion.h"
@@ -1383,3 +1386,32 @@ void LLReflectionMapManager::doOcclusion()
}
}
}
+
+void LLReflectionMapManager::forceDefaultProbeAndUpdateUniforms(bool force)
+{
+ static std::bitset<LL_MAX_REFLECTION_PROBE_COUNT> mProbeWasOccluded;
+
+ if (force)
+ {
+ for (size_t i = 0; i < mProbes.size(); ++i)
+ {
+ auto& probe = mProbes[i];
+ mProbeWasOccluded[i] = probe->mOccluded;
+ if (probe != nullptr && probe != mDefaultProbe)
+ {
+ probe->mOccluded = true;
+ }
+ }
+
+ updateUniforms();
+ }
+ else
+ {
+ for (size_t i = 0; i < mProbes.size(); ++i)
+ {
+ auto& probe = mProbes[i];
+ llassert(probe->mOccluded == (probe != mDefaultProbe));
+ probe->mOccluded = mProbeWasOccluded[i];
+ }
+ }
+}