diff options
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index f99dac6ed6..f4f20ee7a6 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -73,6 +73,7 @@ LLGLSLShader gSkinnedOcclusionProgram; LLGLSLShader gOcclusionCubeProgram; LLGLSLShader gGlowCombineProgram; LLGLSLShader gReflectionMipProgram; +LLGLSLShader gGaussianProgram; LLGLSLShader gRadianceGenProgram; LLGLSLShader gIrradianceGenProgram; LLGLSLShader gGlowCombineFXAAProgram; @@ -377,9 +378,6 @@ void LLViewerShaderMgr::setShaders() LLPipeline::sRenderGlow = gSavedSettings.getBOOL("RenderGlow"); - //hack to reset buffers that change behavior with shaders - gPipeline.resetVertexBuffers(); - if (gViewerWindow) { gViewerWindow->setCursor(UI_CURSOR_WAIT); @@ -2517,6 +2515,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredPostGammaCorrectProgram.mFeatures.hasSrgb = true; gDeferredPostGammaCorrectProgram.mFeatures.isDeferred = true; gDeferredPostGammaCorrectProgram.mShaderFiles.clear(); + gDeferredPostGammaCorrectProgram.clearPermutations(); + U32 tonemapper = gSavedSettings.getU32("RenderTonemapper"); + if (tonemapper == 1) + { + gDeferredPostGammaCorrectProgram.addPermutation("TONEMAP_ACES_NARKOWICZ", "1"); + } + else if (tonemapper == 2) + { + gDeferredPostGammaCorrectProgram.addPermutation("TONEMAP_ACES_HILL_EXPOSURE_BOOST", "1"); + } gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER)); gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredGammaCorrect.glsl", GL_FRAGMENT_SHADER)); gDeferredPostGammaCorrectProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; @@ -3187,12 +3195,20 @@ BOOL LLViewerShaderMgr::loadShadersInterface() gReflectionMipProgram.mShaderFiles.push_back(make_pair("interface/reflectionmipF.glsl", GL_FRAGMENT_SHADER)); gReflectionMipProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; success = gReflectionMipProgram.createShader(NULL, NULL); - if (success) - { - gReflectionMipProgram.bind(); - gReflectionMipProgram.uniform1i(sScreenMap, 0); - gReflectionMipProgram.unbind(); - } + } + + if (success) + { + gGaussianProgram.mName = "Reflection Mip Shader"; + gGaussianProgram.mFeatures.isDeferred = true; + gGaussianProgram.mFeatures.hasGamma = true; + gGaussianProgram.mFeatures.hasAtmospherics = true; + gGaussianProgram.mFeatures.calculatesAtmospherics = true; + gGaussianProgram.mShaderFiles.clear(); + gGaussianProgram.mShaderFiles.push_back(make_pair("interface/splattexturerectV.glsl", GL_VERTEX_SHADER)); + gGaussianProgram.mShaderFiles.push_back(make_pair("interface/gaussianF.glsl", GL_FRAGMENT_SHADER)); + gGaussianProgram.mShaderLevel = mShaderLevel[SHADER_INTERFACE]; + success = gGaussianProgram.createShader(NULL, NULL); } if (success && gGLManager.mHasCubeMapArray) |