From 356678ec53ca940a53fa509eff0b65bb63a403bb Mon Sep 17 00:00:00 2001 From: hunterk Date: Sun, 5 Feb 2023 12:17:01 -0600 Subject: [PATCH] update guest's crt shaders to include some last-minute changes (#365) --- crt/shaders/guest/advanced/deconvergence-ntsc.slang | 6 +++--- crt/shaders/guest/advanced/deconvergence.slang | 6 +++--- crt/shaders/guest/advanced/linearize-ntsc.slang | 9 +++++++-- crt/shaders/guest/advanced/linearize.slang | 10 ++++++++-- crt/shaders/guest/fast/crt-guest-advanced-pass2f.slang | 6 +++--- crt/shaders/guest/fast/deconvergence-f.slang | 6 +++--- crt/shaders/guest/fast/linearize.slang | 10 ++++++++-- crt/shaders/guest/fast/linearizef.slang | 7 ++++++- crt/shaders/guest/hd/deconvergence-hd.slang | 6 +++--- crt/shaders/guest/hd/linearize-hd.slang | 7 ++++++- 10 files changed, 50 insertions(+), 23 deletions(-) diff --git a/crt/shaders/guest/advanced/deconvergence-ntsc.slang b/crt/shaders/guest/advanced/deconvergence-ntsc.slang index 5681293..41269eb 100644 --- a/crt/shaders/guest/advanced/deconvergence-ntsc.slang +++ b/crt/shaders/guest/advanced/deconvergence-ntsc.slang @@ -195,7 +195,7 @@ layout(std140, set = 0, binding = 0) uniform UBO #pragma parameter smoothmask " Smooth Masks in bright scanlines" 0.0 0.0 1.0 1.0 #define smoothmask global.smoothmask -#pragma parameter gamma_out "Gamma out" 1.95 1.0 5.0 0.05 +#pragma parameter gamma_out " Gamma out" 1.95 1.0 5.0 0.05 #define gamma_out global.gamma_out // output gamma @@ -461,7 +461,7 @@ float SlotMask(vec2 pos, float m) if ((slotmask + slotmask1) == 0.0) return 1.0; else { - if (shadowMask == 2.0 || shadowMask == 6.0) pos.x = pos.x + 1.0; + if (shadowMask == 2.0 || shadowMask == 6.0) pos.x = pos.x + slotms; pos = floor(pos/slotms); float mlen = slotwidth*2.0; float px = fract(pos.x/mlen); @@ -667,7 +667,7 @@ if ((abs(global.deconrr) + abs(global.deconrry) + abs(global.deconrg) + abs(glob float smask = SlotMask(maskcoord, mx); cmask*= Mask(maskcoord, mx, mb); - if (mask_layout > 0.5) cmask = cmask.bgr; + if (mask_layout > 0.5) cmask = cmask.rbg; cmask*=smask; vec3 cmask1 = cmask; diff --git a/crt/shaders/guest/advanced/deconvergence.slang b/crt/shaders/guest/advanced/deconvergence.slang index 70d6e6a..592e636 100644 --- a/crt/shaders/guest/advanced/deconvergence.slang +++ b/crt/shaders/guest/advanced/deconvergence.slang @@ -198,7 +198,7 @@ layout(std140, set = 0, binding = 0) uniform UBO #pragma parameter smoothmask " Smooth Masks in bright scanlines" 0.0 0.0 1.0 1.0 #define smoothmask global.smoothmask -#pragma parameter gamma_out "Gamma out" 2.4 1.0 5.0 0.05 +#pragma parameter gamma_out " Gamma out" 2.4 1.0 5.0 0.05 #define gamma_out global.gamma_out // output gamma @@ -464,7 +464,7 @@ float SlotMask(vec2 pos, float m) if ((slotmask + slotmask1) == 0.0) return 1.0; else { - if (shadowMask == 2.0 || shadowMask == 6.0) pos.x = pos.x + 1.0; + if (shadowMask == 2.0 || shadowMask == 6.0) pos.x = pos.x + slotms; pos = floor(pos/slotms); float mlen = slotwidth*2.0; float px = fract(pos.x/mlen); @@ -672,7 +672,7 @@ if ((abs(global.deconrr) + abs(global.deconrry) + abs(global.deconrg) + abs(glob float smask = SlotMask(maskcoord, mx); cmask*= Mask(maskcoord, mx, mb); - if (mask_layout > 0.5) cmask = cmask.bgr; + if (mask_layout > 0.5) cmask = cmask.rbg; cmask*=smask; vec3 cmask1 = cmask; diff --git a/crt/shaders/guest/advanced/linearize-ntsc.slang b/crt/shaders/guest/advanced/linearize-ntsc.slang index 07c4871..a8daf6e 100644 --- a/crt/shaders/guest/advanced/linearize-ntsc.slang +++ b/crt/shaders/guest/advanced/linearize-ntsc.slang @@ -33,7 +33,8 @@ layout(push_constant) uniform Push float intres; float iscans; float downsample_levelx; - float downsample_levely; + float downsample_levely; + float gamma_out; } params; @@ -43,10 +44,14 @@ layout(std140, set = 0, binding = 0) uniform UBO mat4 MVP; } global; +#pragma parameter bogus_gamma "[ GAMMA OPTIONS ]: " 0.0 0.0 0.0 1.0 -#pragma parameter GAMMA_INPUT "Gamma Input" 2.0 1.0 5.0 0.05 +#pragma parameter GAMMA_INPUT " Gamma Input" 2.0 1.0 5.0 0.05 #define GAMMA_INPUT params.GAMMA_INPUT +#pragma parameter gamma_out " Gamma out" 1.95 1.0 5.0 0.05 +#define gamma_out params.gamma_out // output gamma + #pragma parameter bogus_interlacing "[ INTERLACING OPTIONS ]: " 0.0 0.0 0.0 1.0 #pragma parameter inter " Interlace Trigger Resolution :" 400.0 0.0 800.0 25.0 diff --git a/crt/shaders/guest/advanced/linearize.slang b/crt/shaders/guest/advanced/linearize.slang index 0472826..d59bc8c 100644 --- a/crt/shaders/guest/advanced/linearize.slang +++ b/crt/shaders/guest/advanced/linearize.slang @@ -33,7 +33,8 @@ layout(push_constant) uniform Push float intres; float iscans; float downsample_levelx; - float downsample_levely; + float downsample_levely; + float gamma_out; } params; @@ -44,9 +45,14 @@ layout(std140, set = 0, binding = 0) uniform UBO } global; -#pragma parameter GAMMA_INPUT "Gamma Input" 2.4 1.0 5.0 0.05 +#pragma parameter bogus_gamma "[ GAMMA OPTIONS ]: " 0.0 0.0 0.0 1.0 + +#pragma parameter GAMMA_INPUT " Gamma Input" 2.4 1.0 5.0 0.05 #define GAMMA_INPUT params.GAMMA_INPUT +#pragma parameter gamma_out " Gamma out" 2.4 1.0 5.0 0.05 +#define gamma_out params.gamma_out // output gamma + #pragma parameter bogus_interlacing "[ INTERLACING OPTIONS ]: " 0.0 0.0 0.0 1.0 #pragma parameter inter " Interlace Trigger Resolution :" 400.0 0.0 800.0 25.0 diff --git a/crt/shaders/guest/fast/crt-guest-advanced-pass2f.slang b/crt/shaders/guest/fast/crt-guest-advanced-pass2f.slang index 9a11e4c..deaa260 100644 --- a/crt/shaders/guest/fast/crt-guest-advanced-pass2f.slang +++ b/crt/shaders/guest/fast/crt-guest-advanced-pass2f.slang @@ -190,7 +190,7 @@ layout(std140, set = 0, binding = 0) uniform UBO #pragma parameter DES " Deconvergence Strength" 0.7 0.0 1.0 0.05 -#pragma parameter gamma_out "Gamma out" 2.4 1.0 5.0 0.05 +#pragma parameter gamma_out " Gamma out" 2.4 1.0 5.0 0.05 #define gamma_out params.gamma_out // output gamma #pragma parameter inters " Interlacing Effect Smoothness" 0.0 0.0 0.5 0.05 // Joint parameter with linearize pass, values must match @@ -465,7 +465,7 @@ float SlotMask(vec2 pos, float m) if ((slotmask + slotmask1) == 0.0) return 1.0; else { - if (shadowMask == 2.0 || shadowMask == 6.0) pos.x = pos.x + 1.0; + if (shadowMask == 2.0 || shadowMask == 6.0) pos.x = pos.x + slotms; pos = floor(pos/slotms); float mlen = slotwidth*2.0; float px = fract(pos.x/mlen); @@ -731,7 +731,7 @@ if (abs(vertmask) > 0.025) float smask = SlotMask(gl_FragCoord.xy * 1.000001, mx); cmask*= Mask(gl_FragCoord.xy * 1.000001, mx); - if (mask_layout > 0.5) cmask = cmask.bgr; + if (mask_layout > 0.5) cmask = cmask.rbg; color = color*cmask; color = min(color,1.0); diff --git a/crt/shaders/guest/fast/deconvergence-f.slang b/crt/shaders/guest/fast/deconvergence-f.slang index e7f8e52..0d0dfc8 100644 --- a/crt/shaders/guest/fast/deconvergence-f.slang +++ b/crt/shaders/guest/fast/deconvergence-f.slang @@ -184,7 +184,7 @@ layout(std140, set = 0, binding = 0) uniform UBO #pragma parameter smoothmask " Smooth Masks in bright scanlines" 0.0 0.0 1.0 1.0 #define smoothmask global.smoothmask -#pragma parameter gamma_out "Gamma out" 2.4 1.0 5.0 0.05 +#pragma parameter gamma_out " Gamma out" 2.4 1.0 5.0 0.05 #define gamma_out global.gamma_out // output gamma @@ -448,7 +448,7 @@ float SlotMask(vec2 pos, float m) if ((slotmask + slotmask1) == 0.0) return 1.0; else { - if (shadowMask == 2.0 || shadowMask == 6.0) pos.x = pos.x + 1.0; + if (shadowMask == 2.0 || shadowMask == 6.0) pos.x = pos.x + slotms; pos = floor(pos/slotms); float mlen = slotwidth*2.0; float px = fract(pos.x/mlen); @@ -649,7 +649,7 @@ if ((abs(global.deconrr) + abs(global.deconrry) + abs(global.deconrg) + abs(glob float smask = SlotMask(maskcoord, mx); cmask*= Mask(maskcoord, mx, mb); - if (mask_layout > 0.5) cmask = cmask.bgr; + if (mask_layout > 0.5) cmask = cmask.rbg; cmask*=smask; vec3 cmask1 = cmask; diff --git a/crt/shaders/guest/fast/linearize.slang b/crt/shaders/guest/fast/linearize.slang index 0e6fdb0..a440586 100644 --- a/crt/shaders/guest/fast/linearize.slang +++ b/crt/shaders/guest/fast/linearize.slang @@ -33,7 +33,8 @@ layout(push_constant) uniform Push float intres; float iscans; float downsample_levelx; - float downsample_levely; + float downsample_levely; + float gamma_out; } params; @@ -43,10 +44,15 @@ layout(std140, set = 0, binding = 0) uniform UBO mat4 MVP; } global; +#pragma parameter bogus_gamma "[ GAMMA OPTIONS ]: " 0.0 0.0 0.0 1.0 -#pragma parameter GAMMA_INPUT "Gamma Input" 2.4 1.0 5.0 0.05 + +#pragma parameter GAMMA_INPUT " Gamma Input" 2.4 1.0 5.0 0.05 #define GAMMA_INPUT params.GAMMA_INPUT +#pragma parameter gamma_out " Gamma out" 2.4 1.0 5.0 0.05 +#define gamma_out params.gamma_out // output gamma + #pragma parameter bogus_interlacing "[ INTERLACING OPTIONS ]: " 0.0 0.0 0.0 1.0 #pragma parameter inter " Interlace Trigger Resolution :" 400.0 0.0 800.0 25.0 diff --git a/crt/shaders/guest/fast/linearizef.slang b/crt/shaders/guest/fast/linearizef.slang index fea0f33..53e4b55 100644 --- a/crt/shaders/guest/fast/linearizef.slang +++ b/crt/shaders/guest/fast/linearizef.slang @@ -34,6 +34,7 @@ layout(push_constant) uniform Push float inters; float iscan; float intres; + float gamma_out; } params; @@ -42,10 +43,14 @@ layout(std140, set = 0, binding = 0) uniform UBO mat4 MVP; } global; +#pragma parameter bogus_gamma "[ GAMMA OPTIONS ]: " 0.0 0.0 0.0 1.0 -#pragma parameter GAMMA_INPUT "Gamma Input" 2.4 1.0 5.0 0.05 +#pragma parameter GAMMA_INPUT " Gamma Input" 2.4 1.0 5.0 0.05 #define GAMMA_INPUT params.GAMMA_INPUT +#pragma parameter gamma_out " Gamma out" 2.4 1.0 5.0 0.05 +#define gamma_out params.gamma_out // output gamma + #pragma parameter bogus_interlacing "[ INTERLACING OPTIONS ]: " 0.0 0.0 0.0 1.0 #pragma parameter inter " Interlace Trigger Resolution :" 400.0 0.0 800.0 25.0 diff --git a/crt/shaders/guest/hd/deconvergence-hd.slang b/crt/shaders/guest/hd/deconvergence-hd.slang index aa67cba..c066d0d 100644 --- a/crt/shaders/guest/hd/deconvergence-hd.slang +++ b/crt/shaders/guest/hd/deconvergence-hd.slang @@ -187,7 +187,7 @@ layout(std140, set = 0, binding = 0) uniform UBO #pragma parameter smoothmask " Smooth Masks in bright scanlines" 0.0 0.0 1.0 1.0 #define smoothmask global.smoothmask -#pragma parameter gamma_out "Gamma out" 1.75 1.0 5.0 0.05 +#pragma parameter gamma_out " Gamma out" 1.75 1.0 5.0 0.05 #define gamma_out global.gamma_out // output gamma @@ -451,7 +451,7 @@ float SlotMask(vec2 pos, float m) if ((slotmask + slotmask1) == 0.0) return 1.0; else { - if (shadowMask == 2.0 || shadowMask == 6.0) pos.x = pos.x + 1.0; + if (shadowMask == 2.0 || shadowMask == 6.0) pos.x = pos.x + slotms; pos = floor(pos/slotms); float mlen = slotwidth*2.0; float px = fract(pos.x/mlen); @@ -653,7 +653,7 @@ if ((abs(global.deconrr) + abs(global.deconrry) + abs(global.deconrg) + abs(glob float smask = SlotMask(maskcoord, mx); cmask*= Mask(maskcoord, mx, mb); - if (mask_layout > 0.5) cmask = cmask.bgr; + if (mask_layout > 0.5) cmask = cmask.rbg; cmask*=smask; vec3 cmask1 = cmask; diff --git a/crt/shaders/guest/hd/linearize-hd.slang b/crt/shaders/guest/hd/linearize-hd.slang index cf3cbd7..d50935b 100644 --- a/crt/shaders/guest/hd/linearize-hd.slang +++ b/crt/shaders/guest/hd/linearize-hd.slang @@ -33,6 +33,7 @@ layout(push_constant) uniform Push float iscan; float intres; float iscans; + float gamma_out; } params; @@ -42,10 +43,14 @@ layout(std140, set = 0, binding = 0) uniform UBO mat4 MVP; } global; +#pragma parameter bogus_gamma "[ GAMMA OPTIONS ]: " 0.0 0.0 0.0 1.0 -#pragma parameter GAMMA_INPUT "Gamma Input" 1.80 1.0 5.0 0.05 +#pragma parameter GAMMA_INPUT " Gamma Input" 1.80 1.0 5.0 0.05 #define GAMMA_INPUT params.GAMMA_INPUT +#pragma parameter gamma_out " Gamma out" 1.75 1.0 5.0 0.05 +#define gamma_out params.gamma_out // output gamma + #pragma parameter bogus_interlacing "[ INTERLACING OPTIONS ]: " 0.0 0.0 0.0 1.0 #pragma parameter inter " Interlace Trigger Resolution :" 400.0 0.0 800.0 25.0