mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
add back in brightness and contrast controls, as well as the capacity to shut tonemapping off
This commit is contained in:
parent
551b1c5ce6
commit
17d3531206
2 changed files with 25 additions and 3 deletions
|
|
@ -101,7 +101,17 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
|
||||||
sample.g = TORQUE_TEX1D( colorCorrectionTex, sample.g ).g;
|
sample.g = TORQUE_TEX1D( colorCorrectionTex, sample.g ).g;
|
||||||
sample.b = TORQUE_TEX1D( colorCorrectionTex, sample.b ).b;
|
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;
|
return sample;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ uniform float g_fMiddleGray;
|
||||||
uniform float g_fWhiteCutoff;
|
uniform float g_fWhiteCutoff;
|
||||||
|
|
||||||
uniform float g_fEnableBlueShift;
|
uniform float g_fEnableBlueShift;
|
||||||
uniform vec3 g_fBlueShiftColor;
|
uniform vec3 g_fBlueShiftColor;
|
||||||
|
|
||||||
uniform float g_fBloomScale;
|
uniform float g_fBloomScale;
|
||||||
|
|
||||||
|
|
@ -92,7 +92,7 @@ void main()
|
||||||
// Lerp between current color and blue, desaturated copy
|
// Lerp between current color and blue, desaturated copy
|
||||||
vec3 rodColor = dot( _sample.rgb, LUMINANCE_VECTOR ) * g_fBlueShiftColor;
|
vec3 rodColor = dot( _sample.rgb, LUMINANCE_VECTOR ) * g_fBlueShiftColor;
|
||||||
_sample.rgb = mix( _sample.rgb, rodColor, coef );
|
_sample.rgb = mix( _sample.rgb, rodColor, coef );
|
||||||
|
|
||||||
rodColor = dot( bloom.rgb, LUMINANCE_VECTOR ) * g_fBlueShiftColor;
|
rodColor = dot( bloom.rgb, LUMINANCE_VECTOR ) * g_fBlueShiftColor;
|
||||||
bloom.rgb = mix( bloom.rgb, rodColor, coef );
|
bloom.rgb = mix( bloom.rgb, rodColor, coef );
|
||||||
}
|
}
|
||||||
|
|
@ -105,5 +105,17 @@ void main()
|
||||||
_sample.g = texture( colorCorrectionTex, _sample.g ).g;
|
_sample.g = texture( colorCorrectionTex, _sample.g ).g;
|
||||||
_sample.b = texture( colorCorrectionTex, _sample.b ).b;
|
_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;
|
OUT_col = _sample;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue