From b6a482e81093e08316a6e8a9156ff87e34d55637 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 19 Mar 2010 15:25:35 -0500 Subject: Replace RenderDeferredShadow/RenderDeferredSunShadow with RenderShadowDetail --- indra/newview/llviewershadermgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 86b1a8c910..5b7b464e91 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -378,7 +378,7 @@ void LLViewerShaderMgr::setShaders() if (LLPipeline::sRenderDeferred) { - if (gSavedSettings.getBOOL("RenderDeferredShadow")) + if (gSavedSettings.getS32("RenderShadowDetail") > 0) { if (gSavedSettings.getBOOL("RenderDeferredGI")) { //shadows + gi -- cgit v1.2.3 From 32d0d01e864409d966430d005e62869564902b12 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 19 Mar 2010 18:14:17 -0500 Subject: RenderDeferredSSAO works as an independent setting -- decoupled shadows from SSAO. --- indra/newview/llviewershadermgr.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 5b7b464e91..50e5522174 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -973,10 +973,22 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { + S32 level = 0; + std::string fragment; + + if (gSavedSettings.getBOOL("RenderDeferredSSAO")) + { + fragment = "deferred/sunLightSSAOF.glsl"; + } + else + { + fragment = "deferred/sunLightF.glsl"; + } + gDeferredSunProgram.mName = "Deferred Sun Shader"; gDeferredSunProgram.mShaderFiles.clear(); gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSunProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); gDeferredSunProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredSunProgram.createShader(NULL, NULL); } -- cgit v1.2.3 From 2b060b796acdc7c27fb8eb63066c0f9dd689a5f0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 19 Mar 2010 21:25:43 -0500 Subject: Make gcc happy --- indra/newview/llviewershadermgr.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 50e5522174..c15f93d9aa 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -973,7 +973,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { - S32 level = 0; std::string fragment; if (gSavedSettings.getBOOL("RenderDeferredSSAO")) -- cgit v1.2.3 From fb830551d0fef66154ae6652ffaaab3fa3da2bd0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 20 Mar 2010 16:56:36 -0500 Subject: Tweak detail settings and make graphics preferences widget enabling respect requirements. --- indra/newview/llviewershadermgr.cpp | 39 +++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') 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() -- cgit v1.2.3 From 866f5ec559827aac76f35589be0ea6eca961053f Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 4 May 2010 10:25:26 +0100 Subject: EXT-7168 Fix the tying of the deferred prefs UI to the featuretable. --- indra/newview/llviewershadermgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index a0d0b9d490..0e29851778 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -375,7 +375,8 @@ void LLViewerShaderMgr::setShaders() S32 water_class = 2; S32 deferred_class = 0; - if (gSavedSettings.getBOOL("RenderDeferred")) + if (LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && + gSavedSettings.getBOOL("RenderDeferred")) { if (gSavedSettings.getS32("RenderShadowDetail") > 0) { -- cgit v1.2.3