add back in brightness and contrast controls, as well as the capacity to shut tonemapping off

This commit is contained in:
Azaezel 2018-11-12 22:54:00 -06:00
parent 551b1c5ce6
commit 17d3531206
2 changed files with 25 additions and 3 deletions

View file

@ -101,7 +101,17 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
sample.g = TORQUE_TEX1D( colorCorrectionTex, sample.g ).g;
sample.b = TORQUE_TEX1D( colorCorrectionTex, sample.b ).b;
sample = float4(tonemap(sample.rgb),1);
// Apply contrast
sample.rgb = ((sample.rgb - 0.5f) * Contrast) + 0.5f;
// Apply brightness
//sample.rgb += Brightness;
//tonemapping - TODO fix up eye adaptation
if ( g_fEnableToneMapping > 0.0f )
{
sample.rgb = tonemap(sample.rgb);
}
return sample;
}

View file

@ -38,7 +38,7 @@ uniform float g_fMiddleGray;
uniform float g_fWhiteCutoff;
uniform float g_fEnableBlueShift;
uniform vec3 g_fBlueShiftColor;
uniform vec3 g_fBlueShiftColor;
uniform float g_fBloomScale;
@ -92,7 +92,7 @@ void main()
// Lerp between current color and blue, desaturated copy
vec3 rodColor = dot( _sample.rgb, LUMINANCE_VECTOR ) * g_fBlueShiftColor;
_sample.rgb = mix( _sample.rgb, rodColor, coef );
rodColor = dot( bloom.rgb, LUMINANCE_VECTOR ) * g_fBlueShiftColor;
bloom.rgb = mix( bloom.rgb, rodColor, coef );
}
@ -105,5 +105,17 @@ void main()
_sample.g = texture( colorCorrectionTex, _sample.g ).g;
_sample.b = texture( colorCorrectionTex, _sample.b ).b;
// Apply contrast
_sample.rgb = ((_sample.rgb - 0.5f) * Contrast) + 0.5f;
// Apply brightness
//_sample.rgb += Brightness;
//tonemapping - TODO fix up eye adaptation
if ( g_fEnableToneMapping > 0.0f )
{
_sample.rgb = tonemap(_sample.rgb);
}
OUT_col = _sample;
}