diff options
author | Dave Parks <davep@lindenlab.com> | 2010-03-20 16:56:36 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2010-03-20 16:56:36 -0500 |
commit | fb830551d0fef66154ae6652ffaaab3fa3da2bd0 (patch) | |
tree | 51917534cc6920b9f458f1608ab4761241b120da /indra/newview/llviewershadermgr.cpp | |
parent | b576cbfb4289adfe8eecc793cf5e4e7a8f1b502e (diff) |
Tweak detail settings and make graphics preferences widget enabling respect requirements.
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index c15f93d9aa..a0d0b9d490 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -317,10 +317,16 @@ S32 LLViewerShaderMgr::getVertexShaderLevel(S32 type) void LLViewerShaderMgr::setShaders() { - if (!gPipeline.mInitialized || !sInitialized) + //setShaders might be called redundantly by gSavedSettings, so return on reentrance + static bool reentrance = false; + + if (!gPipeline.mInitialized || !sInitialized || reentrance) { return; } + + reentrance = true; + // Make sure the compiled shader map is cleared before we recompile shaders. mShaderObjects.clear(); @@ -368,15 +374,8 @@ void LLViewerShaderMgr::setShaders() S32 wl_class = 2; S32 water_class = 2; S32 deferred_class = 0; - if (!(LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders") - && gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) - { - // user has disabled WindLight in their settings, downgrade - // windlight shaders to stub versions. - wl_class = 1; - } - - if (LLPipeline::sRenderDeferred) + + if (gSavedSettings.getBOOL("RenderDeferred")) { if (gSavedSettings.getS32("RenderShadowDetail") > 0) { @@ -393,6 +392,24 @@ void LLViewerShaderMgr::setShaders() { //no shadows deferred_class = 1; } + + //make sure framebuffer objects are enabled + gSavedSettings.setBOOL("RenderUseFBO", TRUE); + + //make sure hardware skinning is enabled + gSavedSettings.setBOOL("RenderAvatarVP", TRUE); + + //make sure atmospheric shaders are enabled + gSavedSettings.setBOOL("WindLightUseAtmosShaders", TRUE); + } + + + if (!(LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders") + && gSavedSettings.getBOOL("WindLightUseAtmosShaders"))) + { + // user has disabled WindLight in their settings, downgrade + // windlight shaders to stub versions. + wl_class = 1; } if(!gSavedSettings.getBOOL("EnableRippleWater")) @@ -517,6 +534,8 @@ void LLViewerShaderMgr::setShaders() gViewerWindow->setCursor(UI_CURSOR_ARROW); } gPipeline.createGLBuffers(); + + reentrance = false; } void LLViewerShaderMgr::unloadShaders() |