HDR review: remove from reflections, kill depth check, order of operations corrections.

This commit is contained in:
Azaezel 2016-12-27 10:24:49 -06:00
parent 38bf2b8175
commit 646c62d9f4
10 changed files with 47 additions and 67 deletions

View file

@ -41,7 +41,7 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
color.b = TORQUE_TEX1D( colorCorrectionTex, color.b ).b;
// Apply gamma correction
color.rgb = pow( abs(color.rgb), OneOverGamma );
color.rgb = pow( saturate(color.rgb), OneOverGamma );
// Apply contrast
color.rgb = ((color.rgb - 0.5f) * Contrast) + 0.5f;

View file

@ -45,7 +45,7 @@ void main()
color.b = texture( colorCorrectionTex, color.b ).b;
// Apply gamma correction
color.rgb = pow( abs(color.rgb), vec3(OneOverGamma) );
color.rgb = pow( clamp(color.rgb, vec3(0.0),vec3(1.0)), vec3(OneOverGamma) );
// Apply contrast
color.rgb = ((color.rgb - 0.5f) * Contrast) + 0.5f;

View file

@ -28,7 +28,6 @@ TORQUE_UNIFORM_SAMPLER2D(sceneTex, 0);
TORQUE_UNIFORM_SAMPLER2D(luminanceTex, 1);
TORQUE_UNIFORM_SAMPLER2D(bloomTex, 2);
TORQUE_UNIFORM_SAMPLER1D(colorCorrectionTex, 3);
TORQUE_UNIFORM_SAMPLER2D(prepassTex, 4);
uniform float2 texSize0;
uniform float2 texSize2;
@ -40,7 +39,6 @@ uniform float g_fEnableBlueShift;
uniform float3 g_fBlueShiftColor;
uniform float g_fBloomScale;
uniform float g_fOneOverGamma;
uniform float Brightness;
uniform float Contrast;
@ -71,6 +69,9 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
bloom.rgb = lerp( bloom.rgb, rodColor, coef );
}
// Add the bloom effect.
sample += g_fBloomScale * bloom;
// Map the high range of color values into a range appropriate for
// display, taking into account the user's adaptation level,
// white point, and selected value for for middle gray.
@ -82,19 +83,13 @@ float4 main( PFXVertToPix IN ) : TORQUE_TARGET0
sample.rgb = lerp( sample.rgb, sample.rgb * toneScalar, g_fEnableToneMapping );
}
// Add the bloom effect.
float depth = TORQUE_PREPASS_UNCONDITION( prepassTex, IN.uv0 ).w;
if (depth>0.9999)
sample += g_fBloomScale * bloom;
// Apply the color correction.
sample.r = TORQUE_TEX1D( colorCorrectionTex, sample.r ).r;
sample.g = TORQUE_TEX1D( colorCorrectionTex, sample.g ).g;
sample.b = TORQUE_TEX1D( colorCorrectionTex, sample.b ).b;
// Apply gamma correction
sample.rgb = pow( abs(sample.rgb), g_fOneOverGamma );
sample.rgb = pow( saturate(sample.rgb), g_fOneOverGamma );
// Apply contrast
sample.rgb = ((sample.rgb - 0.5f) * Contrast) + 0.5f;

View file

@ -29,7 +29,6 @@ uniform sampler2D sceneTex;
uniform sampler2D luminanceTex;
uniform sampler2D bloomTex;
uniform sampler1D colorCorrectionTex;
uniform sampler2D prepassTex;
uniform vec2 texSize0;
uniform vec2 texSize2;
@ -49,7 +48,6 @@ uniform float Contrast;
out vec4 OUT_col;
void main()
{
vec4 _sample = hdrDecode( texture( sceneTex, IN_uv0 ) );
@ -76,6 +74,9 @@ void main()
bloom.rgb = mix( bloom.rgb, rodColor, coef );
}
// Add the bloom effect.
_sample += g_fBloomScale * bloom;
// Map the high range of color values into a range appropriate for
// display, taking into account the user's adaptation level,
// white point, and selected value for for middle gray.
@ -87,18 +88,13 @@ void main()
_sample.rgb = mix( _sample.rgb, _sample.rgb * toneScalar, g_fEnableToneMapping );
}
// Add the bloom effect.
float depth = prepassUncondition( prepassTex, IN_uv0 ).w;
if (depth>0.9999)
_sample += g_fBloomScale * bloom;
// Apply the color correction.
_sample.r = texture( colorCorrectionTex, _sample.r ).r;
_sample.g = texture( colorCorrectionTex, _sample.g ).g;
_sample.b = texture( colorCorrectionTex, _sample.b ).b;
// Apply gamma correction
_sample.rgb = pow( abs(_sample.rgb), vec3(g_fOneOverGamma) );
_sample.rgb = pow( _sample.rgb, vec3(g_fOneOverGamma) );
// Apply contrast
_sample.rgb = ((_sample.rgb - 0.5f) * Contrast) + 0.5f;