summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp90
1 files changed, 73 insertions, 17 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index b5cda6019b..de62256134 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -89,6 +89,7 @@
#include "llsculptidsize.h"
#include "llavatarappearancedefines.h"
#include "llgltfmateriallist.h"
+#include "gltfscenemanager.h"
const F32 FORCE_SIMPLE_RENDER_AREA = 512.f;
const F32 FORCE_CULL_AREA = 8.f;
@@ -296,6 +297,11 @@ void LLVOVolume::markDead()
{
mLightTexture->removeVolume(LLRender::LIGHT_TEX, this);
}
+
+ if (mIsHeroProbe)
+ {
+ gPipeline.mHeroProbeManager.unregisterViewerObject(this);
+ }
}
LLViewerObject::markDead();
@@ -1128,6 +1134,11 @@ bool LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
}
}
+ if ((volume_params.getSculptType() & LL_SCULPT_TYPE_MASK) == LL_SCULPT_TYPE_GLTF)
+ { // notify GLTFSceneManager about new GLTF object
+ LL::GLTFSceneManager::instance().addGLTFObject(this, volume_params.getSculptID());
+ }
+
return true;
}
else if (NO_LOD == lod)
@@ -1402,6 +1413,12 @@ bool LLVOVolume::calcLOD()
return false;
}
+ if (mGLTFAsset != nullptr)
+ {
+ // do not calculate LOD for GLTF objects
+ return false;
+ }
+
S32 cur_detail = 0;
F32 radius;
@@ -3410,6 +3427,29 @@ bool LLVOVolume::setReflectionProbeIsDynamic(bool is_dynamic)
return false;
}
+bool LLVOVolume::setReflectionProbeIsMirror(bool is_mirror)
+{
+ LLReflectionProbeParams *param_block = (LLReflectionProbeParams *) getParameterEntry(LLNetworkData::PARAMS_REFLECTION_PROBE);
+ if (param_block)
+ {
+ if (param_block->getIsMirror() != is_mirror)
+ {
+ LL_INFOS() << "Setting reflection probe mirror to " << is_mirror << LL_ENDL;
+ param_block->setIsMirror(is_mirror);
+ parameterChanged(LLNetworkData::PARAMS_REFLECTION_PROBE, true);
+
+ if (!is_mirror)
+ gPipeline.mHeroProbeManager.unregisterViewerObject(this);
+ else
+ gPipeline.mHeroProbeManager.registerViewerObject(this);
+
+ return true;
+ }
+ }
+
+ return false;
+}
+
F32 LLVOVolume::getReflectionProbeAmbiance() const
{
const LLReflectionProbeParams* param_block = (const LLReflectionProbeParams*)getParameterEntry(LLNetworkData::PARAMS_REFLECTION_PROBE);
@@ -3458,6 +3498,18 @@ bool LLVOVolume::getReflectionProbeIsDynamic() const
return false;
}
+bool LLVOVolume::getReflectionProbeIsMirror() const
+{
+ const LLReflectionProbeParams *param_block =
+ (const LLReflectionProbeParams *) getParameterEntry(LLNetworkData::PARAMS_REFLECTION_PROBE);
+ if (param_block)
+ {
+ return param_block->getIsMirror();
+ }
+
+ return false;
+}
+
U32 LLVOVolume::getVolumeInterfaceID() const
{
if (mVolumeImpl)
@@ -4378,14 +4430,30 @@ 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.
+
+ if (!mIsHeroProbe)
+ mIsHeroProbe = 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);
+ }
}
}
@@ -5567,7 +5635,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
LLVOVolume* vobj = drawablep->getVOVolume();
- if (!vobj || vobj->isDead())
+ if (!vobj || vobj->isDead() || vobj->mGLTFAsset)
{
continue;
}
@@ -6178,19 +6246,7 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
LLViewerTexture* last_tex = NULL;
- S32 texture_index_channels = 1;
-
- if (gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 30)
- {
- texture_index_channels = LLGLSLShader::sIndexedTextureChannels-1; //always reserve one for shiny for now just for simplicity;
- }
-
- if (distance_sort)
- {
- texture_index_channels = gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels;
- }
-
- texture_index_channels = LLGLSLShader::sIndexedTextureChannels;
+ S32 texture_index_channels = LLGLSLShader::sIndexedTextureChannels;
bool flexi = false;