summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2024-02-06 02:53:57 -0800
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2024-02-06 02:53:57 -0800
commit739ff27c0649af9c74e00f31934d89405ff14373 (patch)
tree1047c3ec7a9c06f94509479940e461fdfbf94bad /indra/newview/llvovolume.cpp
parent086249191078bcfb81d2697509c325fb34ffaf94 (diff)
#740 Make sure we evaluate if the probe is a mirror probe or not.
#682 Re-enable gaussian filtering, and reduce the mirror resolution back to 1024. Also just generally clean up the code a bit.
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp91
1 files changed, 17 insertions, 74 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 77f654be23..54e0a0113d 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -249,9 +249,6 @@ LLVOVolume::~LLVOVolume()
mTextureAnimp = NULL;
delete mVolumeImpl;
mVolumeImpl = NULL;
-
- if (mIsMirror)
- gPipeline.mHeroProbeManager.unregisterHeroDrawable(this);
gMeshRepo.unregisterMesh(this);
@@ -1000,11 +997,6 @@ LLDrawable *LLVOVolume::createDrawable(LLPipeline *pipeline)
updateReflectionProbePtr();
}
- if (isMirror())
- {
- gPipeline.mHeroProbeManager.registerHeroDrawable(this);
- }
-
updateRadius();
bool force_update = true; // avoid non-alpha mDistance update being optimized away
mDrawable->updateDistance(*LLViewerCamera::getInstance(), force_update);
@@ -3327,48 +3319,6 @@ F32 LLVOVolume::getLightCutoff() const
}
}
-bool LLVOVolume::setIsMirror(BOOL is_mirror)
-{
- BOOL was_mirror = isMirror();
- if (is_mirror != was_mirror)
- {
- if (is_mirror)
- {
- setParameterEntryInUse(LLNetworkData::PARAMS_MIRROR, TRUE, true);
- }
- else
- {
- setParameterEntryInUse(LLNetworkData::PARAMS_MIRROR, FALSE, true);
- }
- }
-
- updateMirrorDrawable();
-
- return was_mirror != is_mirror;
-}
-
-void LLVOVolume::updateMirrorDrawable()
-{
- if (isMirror())
- {
- gPipeline.mHeroProbeManager.registerHeroDrawable(this);
- }
- else
- {
- gPipeline.mHeroProbeManager.unregisterHeroDrawable(this);
- }
-}
-
-BOOL LLVOVolume::isMirror() const
-{
- return mIsMirror;
-}
-
-U8 LLVOVolume::mirrorFace() const
-{
- return mMirrorFace;
-}
-
BOOL LLVOVolume::isReflectionProbe() const
{
return getParameterEntryInUse(LLNetworkData::PARAMS_REFLECTION_PROBE);
@@ -3442,22 +3392,6 @@ bool LLVOVolume::setReflectionProbeIsBox(bool is_box)
return false;
}
-bool LLVOVolume::setReflectionProbeIsPlane(bool is_plane)
-{
- LLReflectionProbeParams *param_block = (LLReflectionProbeParams *) getParameterEntry(LLNetworkData::PARAMS_REFLECTION_PROBE);
- if (param_block)
- {
- if (param_block->getIsBox() != is_plane)
- {
- param_block->setIsBox(is_plane);
- parameterChanged(LLNetworkData::PARAMS_REFLECTION_PROBE, true);
- return true;
- }
- }
-
- return false;
-}
-
bool LLVOVolume::setReflectionProbeIsDynamic(bool is_dynamic)
{
LLReflectionProbeParams* param_block = (LLReflectionProbeParams*)getParameterEntry(LLNetworkData::PARAMS_REFLECTION_PROBE);
@@ -4463,25 +4397,34 @@ void LLVOVolume::parameterChanged(U16 param_type, LLNetworkData* data, BOOL in_u
}
updateReflectionProbePtr();
-
- if (isMirror())
- gPipeline.mHeroProbeManager.registerHeroDrawable(this);
- else
- gPipeline.mHeroProbeManager.unregisterHeroDrawable(this);
}
void LLVOVolume::updateReflectionProbePtr()
{
if (isReflectionProbe())
{
- if (mReflectionProbe.isNull())
+ if (mReflectionProbe.isNull() && !getReflectionProbeIsMirror())
{
mReflectionProbe = gPipeline.mReflectionMapManager.registerViewerObject(this);
}
+ else if (mReflectionProbe.isNull() && getReflectionProbeIsMirror())
+ {
+ // Geenz: This is a special case - what we want here is a hero probe.
+ // What we want to do here is instantiate a hero probe from the hero probe manager.
+ gPipeline.mHeroProbeManager.registerViewerObject(this);
+ }
}
- else if (mReflectionProbe.notNull())
+ else if (mReflectionProbe.notNull() || getReflectionProbeIsMirror())
{
- mReflectionProbe = nullptr;
+ if (mReflectionProbe.notNull())
+ {
+ mReflectionProbe = nullptr;
+ }
+
+ if (getReflectionProbeIsMirror())
+ {
+ gPipeline.mHeroProbeManager.unregisterViewerObject(this);
+ }
}
}