Don't apply gamma correction underwater (for now).

meow-7.2.2
Geenz 2013-04-18 21:05:16 -04:00
parent 15bf1a81d1
commit 14b807e55e
2 changed files with 13 additions and 1 deletions

View File

@ -36,9 +36,11 @@ uniform sampler2DRect diffuseRect;
uniform vec2 screen_res;
VARYING vec2 vary_fragcoord;
uniform float texture_gamma;
void main()
{
vec4 diff = texture2DRect(diffuseRect, vary_fragcoord);
frag_color = pow(diff, vec4(0.454545, 0.454545, 0.454545, 1.0));
frag_color = pow(diff, vec4(texture_gamma, texture_gamma, texture_gamma, 1.0));
}

View File

@ -7124,7 +7124,17 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
mScreen.bindTexture(0,channel);
gGL.getTexUnit(channel)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
}
gDeferredPostGammaCorrectProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, mScreen.getWidth(), mScreen.getHeight());
F32 gamma = 1.0;
if (!LLViewerCamera::getInstance()->cameraUnderWater())
{
gamma = 1.0/2.2;
}
gDeferredPostGammaCorrectProgram.uniform1f(LLShaderMgr::TEXTURE_GAMMA, gamma);
gGL.begin(LLRender::TRIANGLE_STRIP);
gGL.texCoord2f(tc1.mV[0], tc1.mV[1]);
gGL.vertex2f(-1,-1);