From a83434897f3480b70ca1d3adb65aa40ef8c3408f Mon Sep 17 00:00:00 2001 From: NAVras-Z Date: Sat, 4 Nov 2017 04:21:20 +0800 Subject: [PATCH] [BotW] contrasty add experimental saturation adjust native saturation found in shader --- .../bd8bba59e2149449_00000000000003c9_ps.txt | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/Enhancement/BreathOfTheWild_Contrasty/bd8bba59e2149449_00000000000003c9_ps.txt b/Enhancement/BreathOfTheWild_Contrasty/bd8bba59e2149449_00000000000003c9_ps.txt index 67d07cb9..e4f8fc3b 100644 --- a/Enhancement/BreathOfTheWild_Contrasty/bd8bba59e2149449_00000000000003c9_ps.txt +++ b/Enhancement/BreathOfTheWild_Contrasty/bd8bba59e2149449_00000000000003c9_ps.txt @@ -1,16 +1,21 @@ #version 420 #extension GL_ARB_texture_gather : enable // shader bd8bba59e2149449 -// Contrasty + Adjustable Bloom +// Contrasty + Adjustable Bloom + Adjust Saturation // original shader dumped using cemu 1.10.0f, BotW 1.3.1 //----------------------------settings------------------------------------- -// #define only_adjustbloom -// uncomment above to only use 'adjustable bloom', all other features in contrasty will be disabled. +#define adjust_bloom 1 +#define adjust_saturation 1 +#define contrasty 1 +// 0: disable, 1: enable. 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 + +const float satFactor = 0.3; // 0.17999995 is neutral. Experimental, adjust native saturation + +const float gamma = 0.81; // 1.0 is neutral. Botw is already colour graded at this stage const float exposure = 1.17; // 1.0 is neutral const float vibrance = 0.008; // 0.0 is neutral const float crushContrast = 0.004; // 0.0 is neutral. Use small increments, loss of shadow detail @@ -18,8 +23,8 @@ const float crushContrast = 0.004; // 0.0 is neutral. Use small increments, loss //-------------------------------------------------------------------------- uniform ivec4 uf_remappedPS[1]; -layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf46ac800 res 320x180x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x5) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 1 -layout(binding = 1) uniform sampler2D textureUnitPS1;// Tex1 addr 0xf5c7b800 res 1280x720x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler1 ClampX/Y/Z: 2 2 2 border: 1 +layout(binding = 0) uniform sampler2D textureUnitPS0; +layout(binding = 1) uniform sampler2D textureUnitPS1; layout(location = 0) in vec4 passParameterSem0; layout(location = 0) out vec4 passPixelColor0; uniform vec2 uf_fragCoordScale; @@ -52,7 +57,11 @@ vec3 cubeMapSTM; int cubeMapFaceId; R0f = passParameterSem0; R1f.xyz = (texture(textureUnitPS0, R0f.xy).xyz); + +#if (adjust_bloom == 1) R1f.xyz *= bloomFactor; +#endif + R0f.xyz = (texture(textureUnitPS1, R0f.xy).xyz); // 0 R126f.x = R1f.x + R0f.x; @@ -134,7 +143,13 @@ R125f.w = R126f.x + -(PS0f); R126f.y = backupReg1f + -(PS0f); PS1f = R126f.y; // 12 + +#if (adjust_saturation == 1) +R126f.x = (mul_nonIEEE(PV1f.y,satFactor) + intBitsToFloat(uf_remappedPS[0].x)); +#else R126f.x = (mul_nonIEEE(PV1f.y,intBitsToFloat(uf_remappedPS[0].y)) + intBitsToFloat(uf_remappedPS[0].x)); +#endif + PV0f.x = R126f.x; PV0f.y = -(R126f.z) + PV1f.x; // 13 @@ -145,8 +160,7 @@ 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); -#ifndef only_adjustbloom -//Color Tweak +#if (contrasty == 1) vec3 fColour = R0f.xyz; fColour = max(vec3(0.0), fColour - vec3(crushContrast)); fColour = clamp(exposure * fColour, 0.0, 1.0);