summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewercontrol.cpp8
-rw-r--r--indra/newview/pipeline.cpp33
-rw-r--r--indra/newview/pipeline.h2
3 files changed, 34 insertions, 9 deletions
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index e53f988c6e..4d86da5f78 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -166,6 +166,12 @@ static bool handleSetShaderChanged(const LLSD& newvalue)
return true;
}
+static bool handleShadowDetailChanged(const LLSD& newvalue)
+{
+ gPipeline.handleShadowDetailChanged();
+ return true;
+}
+
static bool handleRenderPerfTestChanged(const LLSD& newvalue)
{
bool status = !newvalue.asBoolean();
@@ -695,7 +701,7 @@ void settings_setup_listeners()
gSavedSettings.getControl("RenderDebugPipeline")->getSignal()->connect(boost::bind(&handleRenderDebugPipelineChanged, _2));
gSavedSettings.getControl("RenderResolutionDivisor")->getSignal()->connect(boost::bind(&handleRenderResolutionDivisorChanged, _2));
gSavedSettings.getControl("RenderDeferred")->getSignal()->connect(boost::bind(&handleRenderDeferredChanged, _2));
- gSavedSettings.getControl("RenderShadowDetail")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
+ gSavedSettings.getControl("RenderShadowDetail")->getSignal()->connect(boost::bind(&handleShadowDetailChanged, _2));
gSavedSettings.getControl("RenderDeferredSSAO")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
gSavedSettings.getControl("RenderPerformanceTest")->getSignal()->connect(boost::bind(&handleRenderPerfTestChanged, _2));
gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _2));
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 96dd0b895d..c895c8a227 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -10215,14 +10215,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++)
- {
- mShadow[j].bindTarget();
- mShadow[j].clear();
- mShadow[j].flush();
- }
+ skipRenderingShadows();
}
else
{
@@ -11430,6 +11423,30 @@ void LLPipeline::restoreHiddenObject( const LLUUID& id )
}
}
+void LLPipeline::skipRenderingShadows()
+{
+ LLGLDepthTest depth(GL_TRUE);
+
+ for (S32 j = 0; j < 4; j++)
+ {
+ mShadow[j].bindTarget();
+ mShadow[j].clear();
+ mShadow[j].flush();
+ }
+}
+
+void LLPipeline::handleShadowDetailChanged()
+{
+ if (RenderShadowDetail > gSavedSettings.getS32("RenderShadowDetail"))
+ {
+ skipRenderingShadows();
+ }
+ else
+ {
+ LLViewerShaderMgr::instance()->setShaders();
+ }
+}
+
const F32 MIN_DRAW_DISTANCE = 64;
const F32 MAX_DRAW_DISTANCE = 256;
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 7eff573a34..3e5899d973 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -423,6 +423,7 @@ public:
void skipRenderingOfTerrain( bool flag );
void hideObject( const LLUUID& id );
void restoreHiddenObject( const LLUUID& id );
+ void handleShadowDetailChanged();
void autoAdjustSettings();
void setAdjustmentTimerExpiry(F32 expiration);
@@ -437,6 +438,7 @@ private:
void connectRefreshCachedSettingsSafe(const std::string name);
void hideDrawable( LLDrawable *pDrawable );
void unhideDrawable( LLDrawable *pDrawable );
+ void skipRenderingShadows();
public:
enum {GPU_CLASS_MAX = 3 };