From 6b836eacafd21c1ccac2c7276483ed393a4b406e Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 18 Apr 2013 19:43:30 -0400 Subject: Use GL_SRGB8_ALPHA8 for the diffuse and specular buffers, and correct gamma *before* glow and other post processing effects that don't care about being gamma correct. --- indra/newview/llviewershadermgr.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 8096738197..4ce98f0e02 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -200,6 +200,7 @@ LLGLSLShader gDeferredEmissiveProgram; LLGLSLShader gDeferredPostProgram; LLGLSLShader gDeferredCoFProgram; LLGLSLShader gDeferredDoFCombineProgram; +LLGLSLShader gDeferredPostGammaCorrectProgram; LLGLSLShader gFXAAProgram; LLGLSLShader gDeferredPostNoDoFProgram; LLGLSLShader gDeferredWLSkyProgram; @@ -1110,6 +1111,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredPostProgram.unload(); gDeferredCoFProgram.unload(); gDeferredDoFCombineProgram.unload(); + gDeferredPostNoDoFProgram.unload(); + gDeferredPostGammaCorrectProgram.unload(); gFXAAProgram.unload(); gDeferredWaterProgram.unload(); gDeferredWLSkyProgram.unload(); @@ -1650,6 +1653,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredPostNoDoFProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredPostNoDoFProgram.createShader(NULL, NULL); } + + if (success) + { + gDeferredPostGammaCorrectProgram.mName = "Deferred Gamma Correct Shader"; + gDeferredPostGammaCorrectProgram.mShaderFiles.clear(); + gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredGammaCorrect.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredPostGammaCorrectProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredPostGammaCorrectProgram.createShader(NULL, NULL); + } if (success) { -- cgit v1.2.3