From 8a170729104d1a2ffdd5c99486fcbf30f57969ba Mon Sep 17 00:00:00 2001 From: NAVras-Z Date: Mon, 23 Oct 2017 01:16:40 +0800 Subject: [PATCH] [BotW] revert "contrasty happens before tone mapping" credit Hrebo on discord. https://www.reddit.com/r/cemu/comments/77jxd2/botw_contrasty_graphic_pack_colortone_showcase/dopsvmb/ After futher investigation(?lol), found that shader bd8bb also does color tweaking itself, some part looks very similar to contrasty's saturation (lihe@bestminr.com, also updated credit). So it's not worthwhile to re-adjust the current contrasty settings, might just revert it before figuring out the game's own color tweaking. --- .../bd8bba59e2149449_00000000000003c9_ps.txt | 43 ++++++++----------- .../rules.txt | 2 +- 2 files changed, 20 insertions(+), 25 deletions(-) rename Enhancement/{BreathOfTheWild_ColorTweak => BreathOfTheWild_Contrasty}/bd8bba59e2149449_00000000000003c9_ps.txt (93%) rename Enhancement/{BreathOfTheWild_ColorTweak => BreathOfTheWild_Contrasty}/rules.txt (91%) diff --git a/Enhancement/BreathOfTheWild_ColorTweak/bd8bba59e2149449_00000000000003c9_ps.txt b/Enhancement/BreathOfTheWild_Contrasty/bd8bba59e2149449_00000000000003c9_ps.txt similarity index 93% rename from Enhancement/BreathOfTheWild_ColorTweak/bd8bba59e2149449_00000000000003c9_ps.txt rename to Enhancement/BreathOfTheWild_Contrasty/bd8bba59e2149449_00000000000003c9_ps.txt index 3c221fd6..e11aedf6 100644 --- a/Enhancement/BreathOfTheWild_ColorTweak/bd8bba59e2149449_00000000000003c9_ps.txt +++ b/Enhancement/BreathOfTheWild_Contrasty/bd8bba59e2149449_00000000000003c9_ps.txt @@ -6,8 +6,8 @@ //----------------------------settings------------------------------------- -#define only_adjustbloom 0 -//0 false, 1 true: all features except 'adjustable bloom' in contrasty will be disabled. -1 disable all of the contrasty. +const bool only_adjustbloom = false; +// if true, all features except 'adjustable bloom' in contrasty will be disabled. const float bloomFactor = 0.7; // 1.0 is neutral const float gamma = 0.81; // 1.0 is neutral Botw is already colour graded at this stage @@ -52,9 +52,7 @@ vec3 cubeMapSTM; int cubeMapFaceId; R0f = passParameterSem0; R1f.xyz = (texture(textureUnitPS0, R0f.xy).xyz); -#if (only_adjustbloom == 0||only_adjustbloom == 1) R1f.xyz *= bloomFactor; -#endif R0f.xyz = (texture(textureUnitPS1, R0f.xy).xyz); // 0 R126f.x = R1f.x + R0f.x; @@ -63,26 +61,6 @@ R126f.z = R1f.z + R0f.z; PV0f.xyz = vec3(R126f.x,R127f.y,R126f.z); R125f.w = 1.0; -#if (only_adjustbloom == 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*intBitsToFloat(0x3e99096c) + fColour.g*intBitsToFloat(0x3f162b6b) + fColour.b*intBitsToFloat(0x3dea4a8c); -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); - -R126f.x = fColour.x; -R127f.y = fColour.y; -R126f.z = fColour.z; -PV0f.xyz = fColour; -#endif - // 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; @@ -167,6 +145,23 @@ 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); +#if !only_adjustbloom +//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*intBitsToFloat(0x3e99096c) + fColour.g*intBitsToFloat(0x3f162b6b) + fColour.b*intBitsToFloat(0x3dea4a8c); +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); + +R0f.xyz = fColour; +#endif + // export passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w); } diff --git a/Enhancement/BreathOfTheWild_ColorTweak/rules.txt b/Enhancement/BreathOfTheWild_Contrasty/rules.txt similarity index 91% rename from Enhancement/BreathOfTheWild_ColorTweak/rules.txt rename to Enhancement/BreathOfTheWild_Contrasty/rules.txt index 178518f6..2313a792 100644 --- a/Enhancement/BreathOfTheWild_ColorTweak/rules.txt +++ b/Enhancement/BreathOfTheWild_Contrasty/rules.txt @@ -5,7 +5,7 @@ version = 2 # Credit: # getdls for contrasty -# bestminr for vibrance logic +# lihe@bestminr.com for vibrance logic # kiri, navras for tone mapping # navras seperate contrasty from AARemoval