update crt-guest-dr-venom shaders and presets

This commit is contained in:
hunterk 2019-12-18 16:00:23 -06:00
parent ef7bbb1b82
commit 492951eb55
5 changed files with 76 additions and 32 deletions

View file

@ -60,10 +60,11 @@ filter_linear8 = false
scale_type8 = source scale_type8 = source
scale8 = 1.0 scale8 = 1.0
float_framebuffer8 = true float_framebuffer8 = true
alias8 = GlowPass
shader9 = shaders/guest/linearize_scanlines.slang shader9 = shaders/guest/linearize_scanlines.slang
filter_linear9 = true filter_linear9 = true
scale_type9 = source scale_type9 - source
scale9 = 1.0 scale9 = 1.0
float_framebuffer9 = true float_framebuffer9 = true

View file

@ -27,7 +27,7 @@ layout(push_constant) uniform Push
{ {
float TATE, IOS, OS, BLOOM, brightboost, gsl, scanline1, scanline2, beam_min, beam_max, beam_size, float TATE, IOS, OS, BLOOM, brightboost, gsl, scanline1, scanline2, beam_min, beam_max, beam_size,
h_sharp, s_sharp, h_smart, csize, bsize, warpX, warpY, glow, shadowMask, masksize, vertmask, h_sharp, s_sharp, h_smart, csize, bsize, warpX, warpY, glow, shadowMask, masksize, vertmask,
slotmask, slotwidth, double_slot, mcut, maskDark, maskLight, CGWG, GTW, gamma_out; slotmask, slotwidth, double_slot, mcut, maskDark, maskLight, CGWG, GTW, gamma_out, spike;
} params; } params;
#pragma parameter TATE "TATE Mode" 0.0 0.0 1.0 1.0 #pragma parameter TATE "TATE Mode" 0.0 0.0 1.0 1.0
@ -92,6 +92,8 @@ layout(push_constant) uniform Push
#define GTW params.GTW // Gamma tweak #define GTW params.GTW // Gamma tweak
#pragma parameter gamma_out "Gamma out" 2.4 1.0 3.5 0.05 #pragma parameter gamma_out "Gamma out" 2.4 1.0 3.5 0.05
#define gamma_out params.gamma_out // output gamma #define gamma_out params.gamma_out // output gamma
#pragma parameter spike "Scanline Spike Removal (0.0 - for speedup)" 1.0 0.0 2.0 0.2
#define spike params.spike
#define COMPAT_TEXTURE(c,d) texture(c,d) #define COMPAT_TEXTURE(c,d) texture(c,d)
#define TEX0 vTexCoord #define TEX0 vTexCoord
@ -128,10 +130,12 @@ layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 2) uniform sampler2D Source; layout(set = 0, binding = 2) uniform sampler2D Source;
layout(set = 0, binding = 3) uniform sampler2D LinearizePass; layout(set = 0, binding = 3) uniform sampler2D LinearizePass;
layout(set = 0, binding = 4) uniform sampler2D AvgLumPass; layout(set = 0, binding = 4) uniform sampler2D AvgLumPass;
layout(set = 0, binding = 5) uniform sampler2D GlowPass;
#define Texture Source #define Texture Source
#define PassPrev3Texture LinearizePass #define PassPrev5Texture AvgLumPass
#define PassPrev4Texture AvgLumPass #define PassPrev4Texture LinearizePass
#define PassPrev2Texture GlowPass
#define eps 1e-10 #define eps 1e-10
@ -331,7 +335,7 @@ vec3 gamma_correct(vec3 color, vec3 tmp)
void main() void main()
{ {
float lum = COMPAT_TEXTURE(PassPrev4Texture, vec2(0.33,0.33)).a; float lum = COMPAT_TEXTURE(PassPrev5Texture, vec2(0.33,0.33)).a;
// Calculating texel coordinates // Calculating texel coordinates
@ -387,8 +391,8 @@ void main()
else else
{ {
// reading differences for smoothing // reading differences for smoothing
vec3 diffs_top = COMPAT_TEXTURE(PassPrev4Texture, pC4 ).xyz; vec3 diffs_top = COMPAT_TEXTURE(PassPrev5Texture, pC4 ).xyz;
vec3 diffs_bot = COMPAT_TEXTURE(PassPrev4Texture, pC4 + offy).xyz; vec3 diffs_bot = COMPAT_TEXTURE(PassPrev5Texture, pC4 + offy).xyz;
if(TATE > 0.5) if(TATE > 0.5)
{ {
@ -416,24 +420,57 @@ void main()
float wtt = 1.0/(twl2+twl1+twct+twr1+twr2); float wtt = 1.0/(twl2+twl1+twct+twr1+twr2);
float wtb = 1.0/(bwl2+bwl1+bwct+bwr1+bwr2); float wtb = 1.0/(bwl2+bwl1+bwct+bwr1+bwr2);
vec3 l2 = COMPAT_TEXTURE(PassPrev3Texture, pC4 -off2).xyz; vec3 l2 = COMPAT_TEXTURE(PassPrev4Texture, pC4 -off2).xyz;
vec3 l1 = COMPAT_TEXTURE(PassPrev3Texture, pC4 -offx).xyz; vec3 l1 = COMPAT_TEXTURE(PassPrev4Texture, pC4 -offx).xyz;
vec3 ct = COMPAT_TEXTURE(PassPrev3Texture, pC4 ).xyz; vec3 ct = COMPAT_TEXTURE(PassPrev4Texture, pC4 ).xyz;
vec3 r1 = COMPAT_TEXTURE(PassPrev3Texture, pC4 +offx).xyz; vec3 r1 = COMPAT_TEXTURE(PassPrev4Texture, pC4 +offx).xyz;
vec3 r2 = COMPAT_TEXTURE(PassPrev3Texture, pC4 +off2).xyz; vec3 r2 = COMPAT_TEXTURE(PassPrev4Texture, pC4 +off2).xyz;
vec3 sl2 = COMPAT_TEXTURE(Texture, pC4 -off2).xyz;
vec3 sl1 = COMPAT_TEXTURE(Texture, pC4 -offx).xyz;
vec3 sct = COMPAT_TEXTURE(Texture, pC4 ).xyz;
vec3 sr1 = COMPAT_TEXTURE(Texture, pC4 +offx).xyz;
vec3 sr2 = COMPAT_TEXTURE(Texture, pC4 +off2).xyz;
vec3 color1 = (l2*twl2 + l1*twl1 + ct*twct + r1*twr1 + r2*twr2)*wtt; vec3 color1 = (l2*twl2 + l1*twl1 + ct*twct + r1*twr1 + r2*twr2)*wtt;
if (sharp) color1 = clamp(color1, min(min(l1,r1),ct), max(max(l1,r1),ct)); if (sharp) color1 = clamp(color1, min(min(l1,r1),ct), max(max(l1,r1),ct));
l2 = COMPAT_TEXTURE(PassPrev3Texture, pC4 -off2 +offy).xyz; vec3 gtmp = vec3(gamma_out*0.1);
l1 = COMPAT_TEXTURE(PassPrev3Texture, pC4 -offx +offy).xyz; vec3 scolor1 = color1;
ct = COMPAT_TEXTURE(PassPrev3Texture, pC4 +offy).xyz;
r1 = COMPAT_TEXTURE(PassPrev3Texture, pC4 +offx +offy).xyz; if (spike > 0.0)
r2 = COMPAT_TEXTURE(PassPrev3Texture, pC4 +off2 +offy).xyz; {
scolor1 = (sl2*twl2 + sl1*twl1 + sct*twct + sr1*twr1 + sr2*twr2)*wtt;
if (sharp) scolor1 = clamp(scolor1, min(min(sl1,sr1),sct), max(max(sl1,sr1),sct));
scolor1 = pow(scolor1, gtmp);
scolor1 = mix(color1, scolor1, spike);
}
l2 = COMPAT_TEXTURE(PassPrev4Texture, pC4 -off2 +offy).xyz;
l1 = COMPAT_TEXTURE(PassPrev4Texture, pC4 -offx +offy).xyz;
ct = COMPAT_TEXTURE(PassPrev4Texture, pC4 +offy).xyz;
r1 = COMPAT_TEXTURE(PassPrev4Texture, pC4 +offx +offy).xyz;
r2 = COMPAT_TEXTURE(PassPrev4Texture, pC4 +off2 +offy).xyz;
sl2 = COMPAT_TEXTURE(Texture, pC4 -off2 +offy).xyz;
sl1 = COMPAT_TEXTURE(Texture, pC4 -offx +offy).xyz;
sct = COMPAT_TEXTURE(Texture, pC4 +offy).xyz;
sr1 = COMPAT_TEXTURE(Texture, pC4 +offx +offy).xyz;
sr2 = COMPAT_TEXTURE(Texture, pC4 +off2 +offy).xyz;
vec3 color2 = (l2*bwl2 + l1*bwl1 + ct*bwct + r1*bwr1 + r2*bwr2)*wtb; vec3 color2 = (l2*bwl2 + l1*bwl1 + ct*bwct + r1*bwr1 + r2*bwr2)*wtb;
if (sharp) color2 = clamp(color2, min(min(l1,r1),ct), max(max(l1,r1),ct)); if (sharp) color2 = clamp(color2, min(min(l1,r1),ct), max(max(l1,r1),ct));
vec3 scolor2 = color2;
if (spike > 0.0)
{
scolor2 = (sl2*bwl2 + sl1*bwl1 + sct*bwct + sr1*bwr1 + sr2*bwr2)*wtb;
if (sharp) scolor2 = clamp(scolor2, min(min(sl1,sr1),sct), max(max(sl1,sr1),sct));
scolor2 = pow(scolor2, gtmp);
scolor2 = mix(color2, scolor2, spike);
}
// calculating scanlines // calculating scanlines
float f = (TATE < 0.5) ? fp.y : fp.x; float f = (TATE < 0.5) ? fp.y : fp.x;
@ -443,14 +480,19 @@ void main()
float wt1 = st(f, shape1); float wt1 = st(f, shape1);
float wt2 = st(1.0-f, shape2); float wt2 = st(1.0-f, shape2);
vec3 color0 = color1*wt1 + color2*wt2; vec3 color0 = color1*wt1 + color2*wt2;
vec3 scolor0 = scolor1*wt1 + scolor2*wt2;
vec3 ctmp = color0/(wt1+wt2); vec3 ctmp = color0/(wt1+wt2);
vec3 sctmp = scolor0/(wt1+wt2);
vec3 tmp = pow(ctmp, vec3(1.0/gamma_out)); vec3 tmp = pow(ctmp, vec3(1.0/gamma_out));
vec3 w1,w2 = vec3(0.0); vec3 w1,w2 = vec3(0.0);
vec3 cref1 = mix(ctmp, color1, beam_size); vec3 cref1 = mix(sctmp, scolor1, beam_size);
vec3 cref2 = mix(ctmp, color2, beam_size); vec3 cref2 = mix(sctmp, scolor2, beam_size);
vec3 shift = vec3(-vertmask, vertmask, -vertmask); vec3 shift = vec3(-vertmask, vertmask, -vertmask);
@ -476,7 +518,7 @@ void main()
color *= (TATE < 0.5) ? SlotMask(gl_FragCoord.xy * 1.000001,tmp) : color *= (TATE < 0.5) ? SlotMask(gl_FragCoord.xy * 1.000001,tmp) :
SlotMask(gl_FragCoord.yx * 1.000001,tmp); SlotMask(gl_FragCoord.yx * 1.000001,tmp);
vec3 Bloom = COMPAT_TEXTURE(Texture, pos).xyz; vec3 Bloom = COMPAT_TEXTURE(PassPrev2Texture, pos).xyz;
color+=glow*Bloom; color+=glow*Bloom;

View file

@ -6,12 +6,8 @@ layout(push_constant) uniform Push
vec4 OriginalSize; vec4 OriginalSize;
vec4 OutputSize; vec4 OutputSize;
uint FrameCount; uint FrameCount;
float SCANLINE_GAMMA;
} params; } params;
#pragma parameter SCANLINE_GAMMA "Scanline Spike Removal" 12.0 1.0 15.0 0.5
#define SCANLINE_GAMMA params.SCANLINE_GAMMA
layout(std140, set = 0, binding = 0) uniform UBO layout(std140, set = 0, binding = 0) uniform UBO
{ {
mat4 MVP; mat4 MVP;
@ -33,7 +29,10 @@ layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor; layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 2) uniform sampler2D AfterglowPass; layout(set = 0, binding = 2) uniform sampler2D AfterglowPass;
#define PassPrev6Texture AfterglowPass
#define COMPAT_TEXTURE(c,d) texture(c,d)
void main() void main()
{ {
FragColor = vec4(pow(vec3(texture(AfterglowPass, vTexCoord).rgb), vec3(SCANLINE_GAMMA)),1.0/SCANLINE_GAMMA); FragColor = vec4(pow(vec3(COMPAT_TEXTURE(PassPrev6Texture, vTexCoord).rgb), vec3(10.0)),1.0);
} }

View file

@ -50,8 +50,9 @@ shader8 = "../crt/shaders/guest/blur_vert.slang"
filter_linear8 = "false" filter_linear8 = "false"
scale_type8 = "source" scale_type8 = "source"
scale8 = "1.000000" scale8 = "1.000000"
alias8 = GlowPass
shader9 = ../crt/shaders/guest/linearize_scanlines.slang shader9 = "../crt/shaders/guest/linearize_scanlines.slang"
filter_linear9 = true filter_linear9 = true
scale_type9 = source scale_type9 = source
scale9 = 1.0 scale9 = 1.0

View file

@ -72,6 +72,7 @@ filter_linear9 = false
scale_type9 = source scale_type9 = source
scale9 = 1.0 scale9 = 1.0
float_framebuffer9 = true float_framebuffer9 = true
alias9 = GlowPass
shader10 = ../crt/shaders/guest/linearize_scanlines.slang shader10 = ../crt/shaders/guest/linearize_scanlines.slang
filter_linear10 = true filter_linear10 = true