summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2023-04-26 15:38:47 -0700
committerBrad Linden <brad@lindenlab.com>2023-04-26 15:38:47 -0700
commit369945b45da4697735bea7e925d87c65d90b2a5a (patch)
tree1c3d9af52d8e082b589085a87acad2d8a3f6ecd4 /indra/newview/pipeline.cpp
parent9f3f23ffa2ac487741be305068002536b872b015 (diff)
parent162a825dd59c23c9b475d75e0bd5169f3573267b (diff)
Merge remote-tracking branch 'origin/DRTVWR-539' into DRTVWR-559-merge-539
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp54
1 files changed, 37 insertions, 17 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 4bb93d675e..adfac1f934 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -43,6 +43,7 @@
#include "llui.h"
#include "llglheaders.h"
#include "llrender.h"
+#include "llstartup.h"
#include "llwindow.h" // swapBuffers()
// newview includes
@@ -127,6 +128,7 @@ U32 LLPipeline::RenderFSAASamples;
U32 LLPipeline::RenderResolutionDivisor;
bool LLPipeline::RenderUIBuffer;
S32 LLPipeline::RenderShadowDetail;
+S32 LLPipeline::RenderShadowSplits;
bool LLPipeline::RenderDeferredSSAO;
F32 LLPipeline::RenderShadowResolutionScale;
bool LLPipeline::RenderLocalLights;
@@ -481,6 +483,7 @@ void LLPipeline::init()
connectRefreshCachedSettingsSafe("RenderResolutionDivisor");
connectRefreshCachedSettingsSafe("RenderUIBuffer");
connectRefreshCachedSettingsSafe("RenderShadowDetail");
+ connectRefreshCachedSettingsSafe("RenderShadowSplits");
connectRefreshCachedSettingsSafe("RenderDeferredSSAO");
connectRefreshCachedSettingsSafe("RenderShadowResolutionScale");
connectRefreshCachedSettingsSafe("RenderLocalLights");
@@ -549,7 +552,6 @@ void LLPipeline::init()
LLPipeline::~LLPipeline()
{
-
}
void LLPipeline::cleanup()
@@ -965,6 +967,7 @@ void LLPipeline::refreshCachedSettings()
RenderResolutionDivisor = gSavedSettings.getU32("RenderResolutionDivisor");
RenderUIBuffer = gSavedSettings.getBOOL("RenderUIBuffer");
RenderShadowDetail = gSavedSettings.getS32("RenderShadowDetail");
+ RenderShadowSplits = gSavedSettings.getS32("RenderShadowSplits");
RenderDeferredSSAO = gSavedSettings.getBOOL("RenderDeferredSSAO");
RenderShadowResolutionScale = gSavedSettings.getF32("RenderShadowResolutionScale");
RenderLocalLights = gSavedSettings.getBOOL("RenderLocalLights");
@@ -5477,7 +5480,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera)
LLDrawable* drawable = light->drawable;
const LLViewerObject *vobj = light->drawable->getVObj();
if(vobj && vobj->getAvatar()
- && (vobj->getAvatar()->isTooComplex() || vobj->getAvatar()->isInMuteList())
+ && (vobj->getAvatar()->isTooComplex() || vobj->getAvatar()->isInMuteList() || vobj->getAvatar()->isTooSlow())
)
{
drawable->clearState(LLDrawable::NEARBY_LIGHT);
@@ -5556,7 +5559,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera)
continue;
}
LLVOAvatar * av = light->getAvatar();
- if (av && (av->isTooComplex() || av->isInMuteList()))
+ if (av && (av->isTooComplex() || av->isInMuteList() || av->isTooSlow()))
{
// avatars that are already in the list will be removed by removeMutedAVsLights
continue;
@@ -9437,14 +9440,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
if (mSunDiffuse == LLColor4::black)
{ //sun diffuse is totally black shadows don't matter
- LLGLDepthTest depth(GL_TRUE);
-
- for (S32 j = 0; j < 4; j++)
- {
- mRT->shadow[j].bindTarget();
- mRT->shadow[j].clear();
- mRT->shadow[j].flush();
- }
+ skipRenderingShadows();
}
else
{
@@ -9500,7 +9496,8 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
std::vector<LLVector3> fp;
- if (!gPipeline.getVisiblePointCloud(shadow_cam, min, max, fp, lightDir))
+ if (!gPipeline.getVisiblePointCloud(shadow_cam, min, max, fp, lightDir)
+ || j > RenderShadowSplits)
{
//no possible shadow receivers
if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA) && !gCubeSnapshot)
@@ -10070,10 +10067,10 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar, bool preview_avatar)
<< " is " << ( too_complex ? "" : "not ") << "too complex"
<< LL_ENDL;
- pushRenderTypeMask();
-
- if (visually_muted || too_complex)
- {
+ pushRenderTypeMask();
+
+ if (visually_muted || too_complex)
+ {
// only show jelly doll geometry
andRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR,
LLPipeline::RENDER_TYPE_CONTROL_AV,
@@ -10701,9 +10698,32 @@ void LLPipeline::restoreHiddenObject( const LLUUID& id )
}
}
+void LLPipeline::skipRenderingShadows()
+{
+ LLGLDepthTest depth(GL_TRUE);
+
+ for (S32 j = 0; j < 4; j++)
+ {
+ mRT->shadow[j].bindTarget();
+ mRT->shadow[j].clear();
+ mRT->shadow[j].flush();
+ }
+}
+
+void LLPipeline::handleShadowDetailChanged()
+{
+ if (RenderShadowDetail > gSavedSettings.getS32("RenderShadowDetail"))
+ {
+ skipRenderingShadows();
+ }
+ else
+ {
+ LLViewerShaderMgr::instance()->setShaders();
+ }
+}
+
void LLPipeline::overrideEnvironmentMap()
{
//mReflectionMapManager.mProbes.clear();
//mReflectionMapManager.addProbe(LLViewerCamera::instance().getOrigin());
}
-