From e10fdfaa3e428ad00471517d553a24b4f5c48af2 Mon Sep 17 00:00:00 2001 From: Alex Chirila Date: Tue, 21 Nov 2017 08:39:07 +0200 Subject: [PATCH] [BotW] Removed obsolete code in AMD Light Circle fix --- .../cf2e9b7aab93e342_000000000001fe49_ps.txt | 31 +------------------ .../e95d54571be1c0a9_000000000001fe49_ps.txt | 30 +----------------- 2 files changed, 2 insertions(+), 59 deletions(-) diff --git a/Workaround/BreathOfTheWild_!AMDLights/cf2e9b7aab93e342_000000000001fe49_ps.txt b/Workaround/BreathOfTheWild_!AMDLights/cf2e9b7aab93e342_000000000001fe49_ps.txt index 699569ae..884ebab9 100644 --- a/Workaround/BreathOfTheWild_!AMDLights/cf2e9b7aab93e342_000000000001fe49_ps.txt +++ b/Workaround/BreathOfTheWild_!AMDLights/cf2e9b7aab93e342_000000000001fe49_ps.txt @@ -1,16 +1,8 @@ #version 420 #extension GL_ARB_texture_gather : enable // shader cf2e9b7aab93e342 -// Sheikah Tower - inactive, reflection pass -// Glow Lights Color Mod -// Credit for hsv functions http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl +// AMD Light Circle fix - World lights reflection pass -#define HUE_ROTATION 0 //[0, 360] where 0 and 360 is unchanged Hue and 180 is completely opposite Hue. Check http://dba.med.sc.edu/price/irf/Adobe_tg/models/images/hsl_top.JPG -#define SATURATION_FACTOR 0.9 //[0.0, 1.0] 1.0 means unchanged Saturation, 0.0 means completely desaturated. Values above 1.0 are accepted, but they may cause clipping -#define VALUE_FACTOR 0.65 //same as above; applies to Value -#define ALPHA_FACTOR 1.0 //same as above; applies to Transparency - -const float hueRotation = HUE_ROTATION / 360.0; uniform ivec4 uf_remappedPS[10]; layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf5054000 res 640x360x1 dim 1 tm: 4 format 080e compSel: 0 4 4 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 1 layout(binding = 1) uniform sampler2D textureUnitPS1;// Tex1 addr 0xf494a800 res 1280x720x1 dim 1 tm: 4 format 001a compSel: 0 1 2 3 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler1 ClampX/Y/Z: 2 2 2 border: 1 @@ -28,20 +20,6 @@ else if( v == 0xFFFFFFFF ) return floatBitsToInt(clamp(intBitsToFloat(v), 0.0, 1.0)); } float mul_nonIEEE(float a, float b){ if( a == 0.0 || b == 0.0 ) return 0.0; return a*b; } -vec3 rgb2hsv(vec3 c) { - vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); - vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); - vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); - - float d = q.x - min(q.w, q.y); - float e = 1.0e-10; - return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); -} -vec3 hsv2rgb(vec3 c) { - vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); - vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); - return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); -} void main() { ivec4 R0i = ivec4(0); @@ -513,11 +491,4 @@ R1i.w = R4i.w; // export passPixelColor0 = vec4(intBitsToFloat(R0i.x), intBitsToFloat(R0i.y), intBitsToFloat(R0i.z), intBitsToFloat(R0i.w)); passPixelColor1 = vec4(intBitsToFloat(R1i.x), intBitsToFloat(R1i.y), intBitsToFloat(R1i.z), intBitsToFloat(R1i.w)); -vec3 colhsv = rgb2hsv(passPixelColor0.rgb); -passPixelColor0.rgb = hsv2rgb(vec3(mod(colhsv.x + hueRotation, 1.0), colhsv.y*SATURATION_FACTOR, colhsv.z*VALUE_FACTOR)); -passPixelColor0.a *= ALPHA_FACTOR; -colhsv = rgb2hsv(passPixelColor1.rgb); -colhsv = rgb2hsv(passPixelColor1.rgb); -passPixelColor1.rgb = hsv2rgb(vec3(mod(colhsv.x + hueRotation, 1.0), colhsv.y*SATURATION_FACTOR, colhsv.z*VALUE_FACTOR)); -passPixelColor1.a *= ALPHA_FACTOR; } diff --git a/Workaround/BreathOfTheWild_!AMDLights/e95d54571be1c0a9_000000000001fe49_ps.txt b/Workaround/BreathOfTheWild_!AMDLights/e95d54571be1c0a9_000000000001fe49_ps.txt index 7002600e..9d3d90e8 100644 --- a/Workaround/BreathOfTheWild_!AMDLights/e95d54571be1c0a9_000000000001fe49_ps.txt +++ b/Workaround/BreathOfTheWild_!AMDLights/e95d54571be1c0a9_000000000001fe49_ps.txt @@ -1,16 +1,8 @@ #version 420 #extension GL_ARB_texture_gather : enable // shader e95d54571be1c0a9 -// Shrine - balls, reflection pass -// Glow Lights Color Mod -// Credit for hsv functions http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl +// AMD Light Circle fix - Shrine lights reflection pass -#define HUE_ROTATION 0 //[0, 360] where 0 and 360 is unchanged Hue and 180 is completely opposite Hue. Check http://dba.med.sc.edu/price/irf/Adobe_tg/models/images/hsl_top.JPG -#define SATURATION_FACTOR 0.9 //[0.0, 1.0] 1.0 means unchanged Saturation, 0.0 means completely desaturated. Values above 1.0 are accepted, but they may cause clipping -#define VALUE_FACTOR 0.65 //same as above; applies to Value -#define ALPHA_FACTOR 1.0 //same as above; applies to Transparency - -const float hueRotation = HUE_ROTATION / 360.0; uniform ivec4 uf_remappedPS[8]; layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf5054000 res 640x360x1 dim 1 tm: 4 format 080e compSel: 0 4 4 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 1 layout(binding = 1) uniform sampler2D textureUnitPS1;// Tex1 addr 0xf494a800 res 1280x720x1 dim 1 tm: 4 format 001a compSel: 0 1 2 3 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler1 ClampX/Y/Z: 2 2 2 border: 1 @@ -28,20 +20,6 @@ else if( v == 0xFFFFFFFF ) return floatBitsToInt(clamp(intBitsToFloat(v), 0.0, 1.0)); } float mul_nonIEEE(float a, float b){ if( a == 0.0 || b == 0.0 ) return 0.0; return a*b; } -vec3 rgb2hsv(vec3 c) { - vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); - vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); - vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); - - float d = q.x - min(q.w, q.y); - float e = 1.0e-10; - return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); -} -vec3 hsv2rgb(vec3 c) { - vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); - vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); - return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); -} void main() { ivec4 R0i = ivec4(0); @@ -416,11 +394,5 @@ R1i.xyz = ivec3(R7i.x,R7i.y,R7i.z); R1i.w = R7i.w; // export passPixelColor0 = vec4(intBitsToFloat(R0i.x), intBitsToFloat(R0i.y), intBitsToFloat(R0i.z), intBitsToFloat(R0i.w)); -vec3 colhsv = rgb2hsv(passPixelColor0.rgb); -passPixelColor0.rgb = hsv2rgb(vec3(mod(colhsv.x + hueRotation, 1.0), colhsv.y*SATURATION_FACTOR, colhsv.z*VALUE_FACTOR)); -passPixelColor0.a *= ALPHA_FACTOR; passPixelColor1 = vec4(intBitsToFloat(R1i.x), intBitsToFloat(R1i.y), intBitsToFloat(R1i.z), intBitsToFloat(R1i.w)); -colhsv = rgb2hsv(passPixelColor1.rgb); -passPixelColor1.rgb = hsv2rgb(vec3(mod(colhsv.x + hueRotation, 1.0), colhsv.y*SATURATION_FACTOR, colhsv.z*VALUE_FACTOR)); -passPixelColor1.a *= ALPHA_FACTOR; }