diff options
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 67 |
1 files changed, 59 insertions, 8 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 7ef13c3a35..4d62adf3e2 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -137,6 +137,10 @@ LLGLSLShader gGlowProgram; LLGLSLShader gGlowExtractProgram; LLGLSLShader gPostScreenSpaceReflectionProgram; +LLGLSLShader gBloomExtractProgram; +LLGLSLShader gBloomBlurProgram; +LLGLSLShader gBloomCombineProgram; + // Deferred rendering shaders LLGLSLShader gDeferredImpostorProgram; LLGLSLShader gDeferredDiffuseProgram; @@ -802,7 +806,7 @@ std::string LLViewerShaderMgr::loadBasicShaders() if (shadow_detail >= 1) { - attribs["SUN_SHADOW"] = "1"; + attribs["SUN_SHADOW"] = "1"; if (shadow_detail >= 2) { @@ -902,8 +906,9 @@ bool LLViewerShaderMgr::loadShadersWater() bool success = true; bool terrainWaterSuccess = true; + S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail"); bool use_sun_shadow = mShaderLevel[SHADER_DEFERRED] > 1 && - gSavedSettings.getS32("RenderShadowDetail") > 0; + shadow_detail > 0; if (mShaderLevel[SHADER_WATER] == 0) { @@ -1003,6 +1008,52 @@ bool LLViewerShaderMgr::loadShadersEffects() if (success) { + gBloomExtractProgram.mName = "Bloom Extract Shader"; + gBloomExtractProgram.mShaderFiles.clear(); + gBloomExtractProgram.mShaderFiles.push_back(make_pair("effects/bloomExtractV.glsl", GL_VERTEX_SHADER)); + gBloomExtractProgram.mShaderFiles.push_back(make_pair("effects/bloomExtractF.glsl", GL_FRAGMENT_SHADER)); + gBloomExtractProgram.mShaderLevel = mShaderLevel[SHADER_EFFECT]; + + success = gBloomExtractProgram.createShader(); + if (!success) + { + LL_WARNS() << "gBloomExtractProgram creation ERROR" << LL_ENDL; + //LLPipeline::sRenderGlow = false; + } + } + + if (success) + { + gBloomBlurProgram.mName = "Bloom Blur Shader"; + gBloomBlurProgram.mShaderFiles.clear(); + gBloomBlurProgram.mShaderFiles.push_back(make_pair("effects/bloomBlurV.glsl", GL_VERTEX_SHADER)); + gBloomBlurProgram.mShaderFiles.push_back(make_pair("effects/bloomBlurF.glsl", GL_FRAGMENT_SHADER)); + gBloomBlurProgram.mShaderLevel = mShaderLevel[SHADER_EFFECT]; + + success = gBloomBlurProgram.createShader(); + if(!success) + { + LL_WARNS() << "gBloomBlurProgram creation ERROR" << LL_ENDL; + } + } + + if (success) + { + gBloomCombineProgram.mName = "Bloom Combine Shader"; + gBloomCombineProgram.mShaderFiles.clear(); + gBloomCombineProgram.mShaderFiles.push_back(make_pair("effects/bloomCombineV.glsl", GL_VERTEX_SHADER)); + gBloomCombineProgram.mShaderFiles.push_back(make_pair("effects/bloomCombineF.glsl", GL_FRAGMENT_SHADER)); + gBloomCombineProgram.mShaderLevel = mShaderLevel[SHADER_EFFECT]; + + success = gBloomCombineProgram.createShader(); + if(!success) + { + LL_WARNS() << "gBloomCombineProgram creation ERROR" << LL_ENDL; + } + } + + if (success) + { gGlowProgram.mName = "Glow Shader (Post)"; gGlowProgram.mShaderFiles.clear(); gGlowProgram.mShaderFiles.push_back(make_pair("effects/glowV.glsl", GL_VERTEX_SHADER)); @@ -2482,9 +2533,9 @@ bool LLViewerShaderMgr::loadShadersDeferred() if (success && gGLManager.mGLVersion > 3.9f) { std::vector<std::pair<std::string, std::string>> quality_levels = { {"12", "Low"}, - {"23", "Medium"}, - {"28", "High"}, - {"39", "Ultra"} }; + {"23", "Medium"}, + {"28", "High"}, + {"39", "Ultra"} }; int i = 0; bool failed = false; for (const auto& quality_pair : quality_levels) @@ -2535,9 +2586,9 @@ bool LLViewerShaderMgr::loadShadersDeferred() if (gGLManager.mGLVersion > 3.15f && success) { std::vector<std::pair<std::string, std::string>> quality_levels = { {"SMAA_PRESET_LOW", "Low"}, - {"SMAA_PRESET_MEDIUM", "Medium"}, - {"SMAA_PRESET_HIGH", "High"}, - {"SMAA_PRESET_ULTRA", "Ultra"} }; + {"SMAA_PRESET_MEDIUM", "Medium"}, + {"SMAA_PRESET_HIGH", "High"}, + {"SMAA_PRESET_ULTRA", "Ultra"} }; int i = 0; bool failed = false; for (const auto& smaa_pair : quality_levels) |