From 01f2f10337a79c093f2af7b347c51672eeae12b4 Mon Sep 17 00:00:00 2001 From: NAVras-Z Date: Thu, 19 Oct 2017 00:36:43 +0800 Subject: [PATCH] [BotW] make contrasty happen before tone mapping *for experimental purpose, haven't tested. yea bd8bba is tone mapping --- .../bd8bba59e2149449_00000000000003c9_ps.txt | 43 +++++++++++-------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/Enhancement/BreathOfTheWild_Contrasty/bd8bba59e2149449_00000000000003c9_ps.txt b/Enhancement/BreathOfTheWild_Contrasty/bd8bba59e2149449_00000000000003c9_ps.txt index a3130ed3..09344cfb 100644 --- a/Enhancement/BreathOfTheWild_Contrasty/bd8bba59e2149449_00000000000003c9_ps.txt +++ b/Enhancement/BreathOfTheWild_Contrasty/bd8bba59e2149449_00000000000003c9_ps.txt @@ -57,12 +57,33 @@ R1f *= bloomFactor; R0f.xyz = (texture(textureUnitPS1, R0f.xy).xyz); // 0 R126f.x = R1f.x + R0f.x; -PV0f.x = R126f.x; + R127f.y = R1f.y + R0f.y; -PV0f.y = R127f.y; + R126f.z = R1f.z + R0f.z; -PV0f.z = R126f.z; + R125f.w = 1.0; + +//Color Tweak +vec3 fColour = vec3(R126f.x, R127f.y, R126f.z); +fColour = max(vec3(0.0), fColour - vec3(crushContrast)); +fColour = clamp(exposure * fColour, 0.0, 1.0); +fColour = pow(fColour, vec3(1.0 / gamma)); +float luminance = fColour.r*0.299 + fColour.g*0.587 + fColour.b*0.114; +float mn = min(min(fColour.r, fColour.g), fColour.b); +float mx = max(max(fColour.r, fColour.g), fColour.b); +float sat = (1.0-(mx - mn)) * (1.0-mx) * luminance * 5.0; +vec3 lightness = vec3((mn + mx)/2.0); +// vibrance +fColour = mix(fColour, mix(fColour, lightness, -vibrance), sat); +//vec3 fColour = (fColour.xyz - floor) * scale; // Not recommended 0-255->16-235.. + +R126f.x = fColour.x; +R127f.y = fColour.y; +R126f.z = fColour.z; +PV0f.xyz = fColour; + + // 1 tempf.x = dot(vec4(PV0f.x,PV0f.y,PV0f.z,-0.0),vec4(intBitsToFloat(0x3e99096c),intBitsToFloat(0x3f162b6b),intBitsToFloat(0x3dea4a8c),0.0)); PV1f.x = tempf.x; @@ -147,20 +168,6 @@ R0f.x = (mul_nonIEEE(R126f.x,R125f.w) + PV1f.w); R0f.y = (mul_nonIEEE(R126f.x,R127f.z) + PV1f.w); R0f.z = (mul_nonIEEE(R126f.x,R126f.y) + PV1f.w); -//Color Tweak -vec3 fColour = R0f.xyz; -fColour = max(vec3(0.0), fColour - vec3(crushContrast)); -fColour = clamp(exposure * fColour, 0.0, 1.0); -fColour = pow(fColour, vec3(1.0 / gamma)); -float luminance = fColour.r*0.299 + fColour.g*0.587 + fColour.b*0.114; -float mn = min(min(fColour.r, fColour.g), fColour.b); -float mx = max(max(fColour.r, fColour.g), fColour.b); -float sat = (1.0-(mx - mn)) * (1.0-mx) * luminance * 5.0; -vec3 lightness = vec3((mn + mx)/2.0); -// vibrance -fColour = mix(fColour, mix(fColour, lightness, -vibrance), sat); -//vec3 fColour = (fColour.xyz - floor) * scale; // Not recommended 0-255->16-235.. - // export -passPixelColor0 = vec4(fColour.x, fColour.y, fColour.z, R0f.w); +passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w); }