From 3afafd47c4891d85db04667b737f41806e4db7fc Mon Sep 17 00:00:00 2001
From: getdls <cztemplatetest@gmail.com>
Date: Tue, 2 Oct 2018 00:31:49 +0200
Subject: [PATCH] [TP Contrasty] More neutral default, late game fixes

---
 .../49865bd2e62efda1_0000000000000079_ps.txt  |  2 +-
 .../95a5a89d62998e0d_0000000000000079_ps.txt  |  2 +-
 .../c14019840473ff86_00000000000003c9_ps.txt  | 18 +++++++++-------
 .../f42bb0ed469dd804_0000000000001e49_ps.txt  | 21 ++++++++++++-------
 .../TwilightPrincessHD_contrasty/patches.txt  |  4 ++--
 5 files changed, 27 insertions(+), 20 deletions(-)

diff --git a/Enhancement/TwilightPrincessHD_contrasty/49865bd2e62efda1_0000000000000079_ps.txt b/Enhancement/TwilightPrincessHD_contrasty/49865bd2e62efda1_0000000000000079_ps.txt
index 54276366..3c6cb2f0 100644
--- a/Enhancement/TwilightPrincessHD_contrasty/49865bd2e62efda1_0000000000000079_ps.txt
+++ b/Enhancement/TwilightPrincessHD_contrasty/49865bd2e62efda1_0000000000000079_ps.txt
@@ -4,7 +4,7 @@
 // shader 49865bd2e62efda1
 //dark world bloom
 
-const float bloom = 0.975;
+const float bloom = 0.98;
 uniform ivec4 uf_remappedPS[1];
 layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf597f000 res 480x270x1 dim 1 tm: 4 format 001a compSel: 0 1 2 3 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 0
 layout(location = 0) in vec4 passParameterSem0;
diff --git a/Enhancement/TwilightPrincessHD_contrasty/95a5a89d62998e0d_0000000000000079_ps.txt b/Enhancement/TwilightPrincessHD_contrasty/95a5a89d62998e0d_0000000000000079_ps.txt
index 5676fe0e..a09a483c 100644
--- a/Enhancement/TwilightPrincessHD_contrasty/95a5a89d62998e0d_0000000000000079_ps.txt
+++ b/Enhancement/TwilightPrincessHD_contrasty/95a5a89d62998e0d_0000000000000079_ps.txt
@@ -4,7 +4,7 @@
 // shader 95a5a89d62998e0d
 
 // blur
-const float bloom = 0.975;
+const float bloom = 0.98;
 
 uniform ivec4 uf_remappedPS[3];
 layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf59ff000 res 480x270x1 dim 1 tm: 4 format 001a compSel: 0 1 2 3 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 0
diff --git a/Enhancement/TwilightPrincessHD_contrasty/c14019840473ff86_00000000000003c9_ps.txt b/Enhancement/TwilightPrincessHD_contrasty/c14019840473ff86_00000000000003c9_ps.txt
index 6c4a0c16..e2739cc7 100644
--- a/Enhancement/TwilightPrincessHD_contrasty/c14019840473ff86_00000000000003c9_ps.txt
+++ b/Enhancement/TwilightPrincessHD_contrasty/c14019840473ff86_00000000000003c9_ps.txt
@@ -2,15 +2,15 @@
 #extension GL_ARB_texture_gather : enable
 #extension GL_ARB_separate_shader_objects : enable
 // shader c14019840473ff86 //aa
-const float redScale = 0.95; 
-const float greenScale = 1.06; 
-const float blueScale = 1.26;
+const float redScale = 0.92; 
+const float greenScale = 1.02; //5 
+const float blueScale = 1.24;
 const float hazeFactor = 0.1;
 
-const float gamma = 1.015; // 1.0 is neutral  Botw is already colour graded at this stage
-const float exposure = 0.99; // 1.0 is neutral
-const float vibrance = 0.75;  // 0.0 is neutral  
-const float crushContrast = 0.0; // 0.0 is neutral. Use small increments, loss of shadow detail 
+const float gamma = 0.98; // 1.0 is neutral  Botw is already colour graded at this stage
+const float exposure = 1.075; // 1.0 is neutral
+const float vibrance = 0.37;  // 0.0 is neutral  
+const float crushContrast = 0.00; // 0.0 is neutral. Use small increments, loss of shadow detail 
 
 float Sigmoid (float x) {
 
@@ -164,8 +164,10 @@ R0f.z = PV0f.y * 0.25;
 R0f.w = PV0f.x * 0.25;
 // export
 //R0f.xyz = vec3(Sigmoid(R0f.x), Sigmoid(R0f.y),Sigmoid(R0f.z));
-R0f.xyz = contrasty(R0f.xyz);
+//R0f.xyz = contrasty(R0f.xyz);
 //R0f.xyz = clamp(R0f.xyz,0,1);
 
+//vec3 mix(vec3 x, vec3 y, float a)
+R0f.xyz = mix(contrasty(R0f.xyz), vec3(Sigmoid(R0f.x), Sigmoid(R0f.y),Sigmoid(R0f.z)), 0.25);
 passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w);
 }
diff --git a/Enhancement/TwilightPrincessHD_contrasty/f42bb0ed469dd804_0000000000001e49_ps.txt b/Enhancement/TwilightPrincessHD_contrasty/f42bb0ed469dd804_0000000000001e49_ps.txt
index 83eea2f7..fa662946 100644
--- a/Enhancement/TwilightPrincessHD_contrasty/f42bb0ed469dd804_0000000000001e49_ps.txt
+++ b/Enhancement/TwilightPrincessHD_contrasty/f42bb0ed469dd804_0000000000001e49_ps.txt
@@ -3,15 +3,20 @@
 #extension GL_ARB_separate_shader_objects : enable
 // shader f42bb0ed469dd804 //sun
 
-const float redScale = 0.95; 
-const float greenScale = 1.06; 
-const float blueScale = 1.26;
+const float redScale = 0.92; 
+const float greenScale = 1.02; //5 
+const float blueScale = 1.24;
 const float hazeFactor = 0.1;
 
-const float gamma = 1.015; // 1.0 is neutral  Botw is already colour graded at this stage
-const float exposure = 0.99; // 1.0 is neutral
-const float vibrance = 0.75;  // 0.0 is neutral  
-const float crushContrast = 0.0; // 0.0 is neutral. Use small increments, loss of shadow detail 
+const float gamma = 0.98; // 1.0 is neutral  Botw is already colour graded at this stage
+const float exposure = 1.075; // 1.0 is neutral
+const float vibrance = 0.37;  // 0.0 is neutral  
+const float crushContrast = 0.00; // 0.0 is neutral. Use small increments, loss of shadow detail 
+
+float Sigmoid (float x) {
+
+    return 1.0 / (1.0 + (exp(-(x - 0.5) * 5.5))); 
+}
 
 vec3 contrasty(vec3 colour){
 	vec3 fColour = (colour.xyz);
@@ -176,7 +181,7 @@ R0f.y = clamp(R0f.y, 0.0, 1.0);
 R0f.z = mul_nonIEEE(R1f.z, PV0f.y);
 R0f.z = clamp(R0f.z, 0.0, 1.0);
 // export
-R0f.xyz = contrasty(R0f.xyz);
 
+R0f.xyz = mix(contrasty(R0f.xyz), vec3(Sigmoid(R0f.x), Sigmoid(R0f.y),Sigmoid(R0f.z)), 0.25);
 passPixelColor0 = vec4(R0f.x, R0f.y, R0f.z, R0f.w);
 }
diff --git a/Enhancement/TwilightPrincessHD_contrasty/patches.txt b/Enhancement/TwilightPrincessHD_contrasty/patches.txt
index cb1ef704..54f293d9 100644
--- a/Enhancement/TwilightPrincessHD_contrasty/patches.txt
+++ b/Enhancement/TwilightPrincessHD_contrasty/patches.txt
@@ -4,9 +4,9 @@ moduleMatches = 0x1A03E108
 
 #rodata constants
 ###exp and haze settings
-0x100C3EB8 = .float 0.003 ## Near world (over)exposure 
+0x100C3EB8 = .float 0.0034 ## Near world (over)exposure 
 0x100C36C4 = .float 0.0035 ## Bloom npc/object (over) " 
-0x100C3780 = .float 0.003 ## Distant world (over)exposure 
+0x100C3780 = .float 0.0034 ## Distant world (over)exposure 
 0x100C3774 = .float 22.0 ### haze 21 = default  21++~ gradually less 
 
 #0x100871C8  = .float 0.01 #100871C8:.float 0.00050000002   ###cloud float