diff options
author | Graham Linden <graham@lindenlab.com> | 2013-07-25 09:36:13 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2013-07-25 09:36:13 -0700 |
commit | f357269c38a8627aeb67c82c5ee34b49336e0d8b (patch) | |
tree | 1bc688e9548a02799d5c90817193f1a851c74edc /indra/llrender | |
parent | 24cef8d36b13c02ec06c58cc66d9bce040891069 (diff) |
NORSPEC-325 WIP restore gamma (uncorrected) attenuation and unify sRGB conversion in one place
Diffstat (limited to 'indra/llrender')
-rwxr-xr-x | indra/llrender/llglslshader.cpp | 1 | ||||
-rwxr-xr-x | indra/llrender/llglslshader.h | 1 | ||||
-rwxr-xr-x | indra/llrender/llshadermgr.cpp | 13 | ||||
-rwxr-xr-x | indra/llrender/llshadermgr.h | 5 |
4 files changed, 16 insertions, 4 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index ac16e30796..b854218e3d 100755 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -87,6 +87,7 @@ LLShaderFeatures::LLShaderFeatures() , mIndexedTextureChannels(0) , disableTextureIndex(false) , hasAlphaMask(false) + , hasSRGB(false) { } diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index eabdb9fc92..dadffeb6c4 100755 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -50,6 +50,7 @@ public: S32 mIndexedTextureChannels; bool disableTextureIndex; bool hasAlphaMask; + bool hasSRGB; // char numLights; diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 942f6dc86f..c3e76f5e0e 100755 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -175,6 +175,14 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) // Attach Fragment Shader Features Next /////////////////////////////////////// + if (features->hasSRGB) + { + if (!shader->attachObject("deferred/srgb.glsl")) + { + return FALSE; + } + } + if(features->calculatesAtmospherics) { if (features->hasWaterFog) @@ -1137,12 +1145,13 @@ void LLShaderMgr::initAttribsAndUniforms() mReservedUniforms.push_back("projectionMap"); mReservedUniforms.push_back("global_gamma"); - mReservedUniforms.push_back("texture_gamma"); - mReservedUniforms.push_back("display_gamma"); + mReservedUniforms.push_back("texture_gamma"); mReservedUniforms.push_back("specular_color"); mReservedUniforms.push_back("env_intensity"); + mReservedUniforms.push_back("display_gamma"); + llassert(mReservedUniforms.size() == END_RESERVED_UNIFORMS); std::set<std::string> dupe_check; diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index 2cbeea5049..3c282bf24f 100755 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -167,12 +167,13 @@ public: DEFERRED_PROJECTION, GLOBAL_GAMMA, - TEXTURE_GAMMA, - DISPLAY_GAMMA, + TEXTURE_GAMMA, SPECULAR_COLOR, ENVIRONMENT_INTENSITY, + DISPLAY_GAMMA, + END_RESERVED_UNIFORMS } eGLSLReservedUniforms; |