diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-02-14 18:59:55 +0200 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2022-02-14 18:59:55 +0200 |
commit | 95f7b552adf179b47cb74a4e39581e8d9c58dddc (patch) | |
tree | 6c1bf5ab05d68132595d9df2b787786b0c37a691 /indra/newview/pipeline.cpp | |
parent | 7af2d51f57416cb68b435cecfd4eacf5d1a4c9fc (diff) |
SL-16841 Skip rendering shadows when decreasing shadow detail setting to avoid stalls
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r-- | indra/newview/pipeline.cpp | 33 |
1 files changed, 25 insertions, 8 deletions
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; |