Unverified Commit 35c2d706 authored by hunterk's avatar hunterk Committed by GitHub
Browse files

add crt-hyllian and crt-guest updates (#166)

* add TATE mode to mame_hlsl

* add crt-guest-dr-venom2 shaders and presets

* get rid of weird character in filename

* add updated crt-hyllian shaders and presets

* update guest's deconvergence to latest

* more gdv updates

* forgot one
parent 65a89c93
Pipeline #13723 passed with stage
in 53 seconds
......@@ -3,7 +3,8 @@
/*
Hyllian Smart-Blur Shader
Copyright (C) 2011-2016 Hyllian - sergiogdb@gmail.com
Copyright (C) 2011-2020 Hyllian - sergiogdb@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
......@@ -27,11 +28,13 @@ layout(push_constant) uniform Push
vec4 OriginalSize;
vec4 OutputSize;
uint FrameCount;
float SB_BLUR_LEVEL;
float SB_RED_THRESHOLD;
float SB_GREEN_THRESHOLD;
float SB_BLUE_THRESHOLD;
} params;
#pragma parameter SB_BLUR_LEVEL "Smart Blur Level" 0.66 0.00 1.00 0.02
#pragma parameter SB_RED_THRESHOLD "Smart Blur Red Threshold" 0.2 0.0 0.6 0.01
#pragma parameter SB_GREEN_THRESHOLD "Smart Blur Green Threshold" 0.2 0.0 0.6 0.01
#pragma parameter SB_BLUE_THRESHOLD "Smart Blur Blue Threshold" 0.2 0.0 0.6 0.01
......@@ -99,9 +102,9 @@ void main()
if (eq(E,F) && eq(E,H) && eq(E,I) && eq(E,B) && eq(E,C) && eq(E,A) && eq(E,D) && eq(E,G))
{
sum = (E+A+C+D+F+G+I+B+H)/9.0;
E = sum;
sum = (A+C+D+F+G+I+B+H)/8.0;
E = mix(E, sum, params.SB_BLUR_LEVEL);
}
FragColor = vec4(E, 1.0);
}
\ No newline at end of file
}
shaders = 11
shader0 = ../stock.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0
alias0 = StockPass
shader1 = shaders/guest/crt-gdv-new/afterglow0.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = AfterglowPass
shader2 = shaders/guest/crt-gdv-new/pre-shaders-afterglow.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
alias2 = PrePass
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3;SamplerLUT4"
SamplerLUT1 = shaders/guest/lut/sony_trinitron1.png
SamplerLUT1_linear = true
SamplerLUT2 = shaders/guest/lut/sony_trinitron2.png
SamplerLUT2_linear = true
SamplerLUT3 = shaders/guest/lut/other1.png
SamplerLUT3_linear = true
SamplerLUT4 = shaders/guest/lut/custom_lut.png
SamplerLUT4_linear = true
shader3 = shaders/guest/crt-gdv-new/avg-lum.slang
filter_linear3 = true
scale_type3 = source
scale3 = 1.0
mipmap_input3 = true
alias3 = AvgLumPass
shader4 = shaders/guest/crt-gdv-new/linearize.slang
filter_linear4 = true
scale_type4 = source
scale4 = 1.0
alias4 = LinearizePass
float_framebuffer4 = true # comment this line for max precision
shader5 = shaders/guest/crt-gdv-new/gaussian_horizontal.slang
filter_linear5 = true
scale_type_x5 = viewport
scale_x5 = 0.5
scale_type_y5 = source
scale_y5 = 1.0
shader6 = shaders/guest/crt-gdv-new/gaussian_vertical.slang
filter_linear6 = true
scale_type_x6 = viewport
scale_x6 = 0.5
scale_type_y6 = viewport
scale_y6 = 0.5
alias6 = GlowPass
shader7 = shaders/guest/crt-gdv-new/bloom_horizontal.slang
filter_linear7 = true
scale_type_x7 = source
scale_x7 = 1.0
scale_type_y7 = source
scale_y7 = 1.0
shader8 = shaders/guest/crt-gdv-new/bloom_vertical.slang
filter_linear8 = true
scale_type_x8 = source
scale_x8 = 1.0
scale_type_y8 = source
scale_y8 = 1.0
alias8 = BloomPass
shader9 = shaders/guest/crt-gdv-new/crt-guest-dr-venom2.slang
filter_linear9 = true
scale_type9 = viewport
scale_x9 = 1.0
scale_y9 = 1.0
shader10 = shaders/guest/crt-gdv-new/deconvergence.slang
filter_linear10 = true
scale_type10 = viewport
scale_x10 = 1.0
scale_y10 = 1.0
shaders = 1
shader0 = shaders/crt-hyllian-3d.slang
shader0 = shaders/hyllian/crt-hyllian-3d.slang
filter_linear0 = true
shaders = 1
shader0 = shaders/hyllian/crt-hyllian-curvature.slang
filter_linear0 = false
shaders = 6
shader0 = shaders/glow/linearize.slang
filter_linear0 = false
srgb_framebuffer0 = true
shader1 = shaders/crt-hyllian-glow/crt-hyllian.slang
filter_linear1 = false
scale_type1 = viewport
scale1 = 1.0
srgb_framebuffer1 = true
alias1 = CRT_PASS
shader2 = shaders/glow/threshold.slang
filter_linear2 = false
srgb_framebuffer2 = true
shader3 = shaders/glow/blur_horiz.slang
mipmap_input3 = true
filter_linear3 = true
scale_type3 = source
scale3 = 0.25
srgb_framebuffer3 = true
shader4 = shaders/glow/blur_vert.slang
filter_linear4 = true
srgb_framebuffer4 = true
shader5 = shaders/crt-hyllian-glow/resolve2.slang
filter_linear5 = true
\ No newline at end of file
shaders = "6"
shader0 = "shaders/glow/linearize.slang"
filter_linear0 = "false"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = ""
float_framebuffer0 = "false"
srgb_framebuffer0 = "true"
shader1 = "shaders/hyllian/crt-hyllian.slang"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "CRTPass"
float_framebuffer1 = "false"
srgb_framebuffer1 = "true"
scale_type_x1 = "viewport"
scale_x1 = "1.000000"
scale_type_y1 = "viewport"
scale_y1 = "1.000000"
shader2 = "shaders/glow/threshold.slang"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = ""
float_framebuffer2 = "false"
srgb_framebuffer2 = "true"
shader3 = "shaders/glow/blur_horiz.slang"
filter_linear3 = "true"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "true"
alias3 = ""
float_framebuffer3 = "false"
srgb_framebuffer3 = "true"
scale_type_x3 = "viewport"
scale_x3 = "0.200000"
scale_type_y3 = "viewport"
scale_y3 = "0.200000"
shader4 = "shaders/glow/blur_vert.slang"
filter_linear4 = "true"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
alias4 = ""
float_framebuffer4 = "false"
srgb_framebuffer4 = "true"
shader5 = "shaders/glow/resolve.slang"
filter_linear5 = "true"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
alias5 = ""
float_framebuffer5 = "false"
srgb_framebuffer5 = "false"
parameters = "INPUT_GAMMA;BEAM_PROFILE;HFILTER_PROFILE;BEAM_MIN_WIDTH;BEAM_MAX_WIDTH;SCANLINES_STRENGTH;COLOR_BOOST;HFILTER_SHARPNESS;PHOSPHOR_LAYOUT;MASK_INTENSITY;CRT_ANTI_RINGING;InputGamma;OutputGamma;VSCANLINES;GLOW_WHITEPOINT;GLOW_ROLLOFF;BLOOM_STRENGTH;OUTPUT_GAMMA;CURVATURE;warpX;warpY;cornersize;cornersmooth;noise_amt;shadowMask;maskDark;maskLight"
INPUT_GAMMA = "2.400000"
BEAM_PROFILE = "0.000000"
HFILTER_PROFILE = "0.000000"
BEAM_MIN_WIDTH = "0.860000"
BEAM_MAX_WIDTH = "1.000000"
SCANLINES_STRENGTH = "0.580000"
COLOR_BOOST = "1.250000"
HFILTER_SHARPNESS = "1.000000"
PHOSPHOR_LAYOUT = "4.000000"
MASK_INTENSITY = "0.500000"
CRT_ANTI_RINGING = "1.000000"
InputGamma = "1.000000"
OutputGamma = "1.000000"
VSCANLINES = "0.000000"
GLOW_WHITEPOINT = "0.500000"
GLOW_ROLLOFF = "1.200000"
BLOOM_STRENGTH = "0.100000"
OUTPUT_GAMMA = "2.200000"
CURVATURE = "0.000000"
warpX = "0.031000"
warpY = "0.031000"
cornersize = "0.030000"
cornersmooth = "1000.000000"
noise_amt = "1.000000"
shadowMask = "0.000000"
maskDark = "0.500000"
maskLight = "1.500000"
shaders = 2
shader0 = shaders/crt-hyllian-multipass/crt-hyllian-pass0.slang
shader0 = shaders/hyllian/crt-hyllian-multipass/crt-hyllian-pass0.slang
filter_linear0 = false
srgb_framebuffer0 = true
scale_type_x0 = viewport
......@@ -8,7 +8,7 @@ scale_type_y0 = source
scale_x0 = 1.0
scale_y0 = 1.0
shader1 = shaders/crt-hyllian-multipass/crt-hyllian-pass1.slang
shader1 = shaders/hyllian/crt-hyllian-multipass/crt-hyllian-pass1.slang
filter_linear1 = false
# Uncomment these lines for a sharper variation
......
shaders = "6"
shader0 = "shaders/glow/linearize.slang"
filter_linear0 = "false"
wrap_mode0 = "clamp_to_border"
mipmap_input0 = "false"
alias0 = ""
float_framebuffer0 = "false"
srgb_framebuffer0 = "true"
shader1 = "shaders/hyllian/crt-hyllian-sinc.slang"
filter_linear1 = "false"
wrap_mode1 = "clamp_to_border"
mipmap_input1 = "false"
alias1 = "CRTPass"
float_framebuffer1 = "false"
srgb_framebuffer1 = "true"
scale_type_x1 = "viewport"
scale_x1 = "1.000000"
scale_type_y1 = "viewport"
scale_y1 = "1.000000"
shader2 = "shaders/glow/threshold.slang"
filter_linear2 = "false"
wrap_mode2 = "clamp_to_border"
mipmap_input2 = "false"
alias2 = ""
float_framebuffer2 = "false"
srgb_framebuffer2 = "true"
shader3 = "shaders/glow/blur_horiz.slang"
filter_linear3 = "true"
wrap_mode3 = "clamp_to_border"
mipmap_input3 = "true"
alias3 = ""
float_framebuffer3 = "false"
srgb_framebuffer3 = "true"
scale_type_x3 = "viewport"
scale_x3 = "0.200000"
scale_type_y3 = "viewport"
scale_y3 = "0.200000"
shader4 = "shaders/glow/blur_vert.slang"
filter_linear4 = "true"
wrap_mode4 = "clamp_to_border"
mipmap_input4 = "false"
alias4 = ""
float_framebuffer4 = "false"
srgb_framebuffer4 = "true"
shader5 = "shaders/glow/resolve.slang"
filter_linear5 = "true"
wrap_mode5 = "clamp_to_border"
mipmap_input5 = "false"
alias5 = ""
float_framebuffer5 = "false"
srgb_framebuffer5 = "false"
parameters = "INPUT_GAMMA;BEAM_PROFILE;BEAM_MIN_WIDTH;BEAM_MAX_WIDTH;SCANLINES_STRENGTH;COLOR_BOOST;HFILTER_SHARPNESS;PHOSPHOR_LAYOUT;MASK_INTENSITY;CRT_ANTI_RINGING;InputGamma;OutputGamma;VSCANLINES;GLOW_WHITEPOINT;GLOW_ROLLOFF;BLOOM_STRENGTH;OUTPUT_GAMMA;CURVATURE;warpX;warpY;cornersize;cornersmooth;noise_amt;shadowMask;maskDark;maskLight"
INPUT_GAMMA = "2.400000"
BEAM_PROFILE = "0'.000000"
BEAM_MIN_WIDTH = "0.860000"
BEAM_MAX_WIDTH = "1.000000"
SCANLINES_STRENGTH = "0.720000"
COLOR_BOOST = "1.250000"
PHOSPHOR_LAYOUT = "4.000000"
MASK_INTENSITY = "0.500000"
CRT_ANTI_RINGING = "1.000000"
InputGamma = "1.000000"
OutputGamma = "1.000000"
VSCANLINES = "0.000000"
GLOW_WHITEPOINT = "0.500000"
GLOW_ROLLOFF = "1.200000"
BLOOM_STRENGTH = "0.100000"
OUTPUT_GAMMA = "2.200000"
CURVATURE = "0.000000"
warpX = "0.031000"
warpY = "0.031000"
cornersize = "0.030000"
cornersmooth = "1000.000000"
noise_amt = "1.000000"
shadowMask = "0.000000"
maskDark = "0.500000"
maskLight = "1.500000"
shaders = 1
shader0 = shaders/hyllian/crt-hyllian-sinc.slang
filter_linear0 = false
shaders = 1
shader0 = shaders/crt-hyllian.slang
shader0 = shaders/hyllian/crt-hyllian.slang
filter_linear0 = false
......@@ -23,24 +23,18 @@
layout(push_constant) uniform Push
{
float SW, AR, PR, AG, PG, AB, PB, sat;
float AS, PR, PG, PB, sat;
} params;
#pragma parameter SW "Afterglow switch ON/OFF" 1.0 0.0 1.0 1.0
#pragma parameter AR "Afterglow Red (more is more)" 0.07 0.0 1.0 0.01
#pragma parameter AS "Afterglow Strength" 0.07 0.0 1.0 0.01
#pragma parameter PR "Persistence Red (more is less)" 0.05 0.0 1.0 0.01
#pragma parameter AG "Afterglow Green" 0.07 0.0 1.0 0.01
#pragma parameter PG "Persistence Green" 0.05 0.0 1.0 0.01
#pragma parameter AB "Afterglow Blue" 0.07 0.0 1.0 0.01
#pragma parameter PB "Persistence Blue" 0.05 0.0 1.0 0.01
#pragma parameter sat "Afterglow saturation" 0.10 0.0 1.0 0.01
#define SW params.SW
#define AR params.AR
#define AS params.AS
#define PR params.PR
#define AG params.AG
#define PG params.PG
#define AB params.AB
#define PB params.PB
#define sat params.sat
......@@ -86,7 +80,7 @@ layout(set = 0, binding = 8) uniform sampler2D OriginalHistory6;
vec3 afterglow(float number)
{
return vec3(AR, AG, AB)*exp2(-vec3(PR, PG, PB)*vec3(number*number));
return vec3(AS)*exp2(-vec3(PR, PG, PB)*vec3(number*number));
}
void main()
......@@ -107,5 +101,5 @@ void main()
float w = 1.0;
if ((color.r + color.g + color.b) > 7.0/255.0) w = 0.0;
FragColor = vec4(color + SW*w*glow,1.0);
FragColor = vec4(color + w*glow,1.0);
}
\ No newline at end of file
#version 450
/*
Phosphor Afterglow Shader pass 0
Copyright (C) 2020 guest(r) - guest.r@gmail.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
layout(push_constant) uniform Push
{
float PR, PG, PB;
} params;
#pragma parameter bogus_afterglow "[ AFTERGLOW SETTINGS ]:" 0.0 0.0 1.0 1.0
#pragma parameter PR " Persistence Red" 0.14 0.0 0.25 0.01
#pragma parameter PG " Persistence Green" 0.14 0.0 0.25 0.01
#pragma parameter PB " Persistence Blue" 0.14 0.0 0.25 0.01
#define PR params.PR
#define PG params.PG
#define PB params.PB
#define COMPAT_TEXTURE(c,d) texture(c,d)
layout(std140, set = 0, binding = 0) uniform UBO
{
mat4 MVP;
} global;
#pragma stage vertex
layout(location = 0) in vec4 Position;
layout(location = 1) in vec2 TexCoord;
layout(location = 0) out vec2 vTexCoord;
void main()
{
gl_Position = global.MVP * Position;
vTexCoord = TexCoord;
}
#pragma stage fragment
layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 2) uniform sampler2D OriginalHistory0;
layout(set = 0, binding = 3) uniform sampler2D AfterglowPassFeedback;
#define TEX0 vTexCoord
void main()
{
vec3 color = COMPAT_TEXTURE(OriginalHistory0, TEX0.xy).rgb;
vec3 accumulate = COMPAT_TEXTURE(AfterglowPassFeedback, TEX0.xy).rgb;
float w = 1.0;
if ((color.r + color.g + color.b < 3.0/255.0)) { w = 0.0; }
vec3 result = mix( max(mix(color, accumulate, 0.74 + vec3(PR, PG, PB))- 2.0/255.0, 0.0)*(255.0/255.0), color, w);
FragColor = vec4(result, w);
}
\ No newline at end of file
#version 450
/*
Average Luminance Shader
Copyright (C) 2018-2020 guest(r) - guest.r@gmail.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Thanks to HunterK for the mipmap hint. :D
*/
layout(push_constant) uniform Push
{
uint FrameCount;
vec4 SourceSize;
float lsmooth;
} params;
#pragma parameter lsmooth "Raster Bloom Effect Smoothing" 0.90 0.50 0.99 0.01
#define lsmooth params.lsmooth
#define COMPAT_TEXTURE(c,d) texture(c,d)
#define SourceSize params.SourceSize
#define InputSize SourceSize
#define TEX0 vTexCoord
layout(std140, set = 0, binding = 0) uniform UBO
{
mat4 MVP;
} global;
#pragma stage vertex
layout(location = 0) in vec4 Position;
layout(location = 1) in vec2 TexCoord;
layout(location = 0) out vec2 vTexCoord;
void main()
{
gl_Position = global.MVP * Position;
vTexCoord = TexCoord * 1.0001;
}
#pragma stage fragment
layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 2) uniform sampler2D OriginalHistory0;
layout(set = 0, binding = 3) uniform sampler2D AvgLumPassFeedback;
#define PassPrev2Texture WhitePointPass
void main()
{
if (vTexCoord.x > 0.2 || vTexCoord.y > 0.2) discard;
float m = max(log2(SourceSize.x), log2(SourceSize.y));
m = max(m - 1.0, 1.0);
float ltotal = 0.0;
ltotal+= max(0.0, length(textureLod(OriginalHistory0, vec2(0.25, 0.25), m).rgb));
ltotal+= max(0.0, length(textureLod(OriginalHistory0, vec2(0.25, 0.75), m).rgb));
ltotal+= max(0.0, length(textureLod(OriginalHistory0, vec2(0.75, 0.25), m).rgb));
ltotal+= max(0.0, length(textureLod(OriginalHistory0, vec2(0.75, 0.75), m).rgb));
ltotal*=0.25;
ltotal = pow(0.577350269 * ltotal, 0.6);
float lhistory = texture(AvgLumPassFeedback, vec2(0.1,0.1)).a;
ltotal = mix(ltotal, lhistory, lsmooth);
FragColor = vec4(ltotal);
}
\ No newline at end of file
#version 450
/*
Average Luminance Shader, Smart Edge Interpolation Coefficients Calculation
Copyright (C) 2018-2020 guest(r) - guest.r@gmail.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Thanks to HunterK for the mipmap hint. :D
*/
layout(push_constant) uniform Push
{
uint FrameCount;
vec4 SourceSize;
float lsmooth;
float sth;
} params;
#pragma parameter lsmooth "Raster Bloom Effect Smoothing" 0.75 0.50 0.99 0.01
#define lsmooth params.lsmooth
#define COMPAT_TEXTURE(c,d) texture(c,d)
#define SourceSize params.SourceSize
#define InputSize SourceSize
#define TEX0 vTexCoord
layout(std140, set = 0, binding = 0) uniform UBO
{
mat4 MVP;
} global;
#pragma stage vertex
layout(location = 0) in vec4 Position;
layout(location = 1) in vec2 TexCoord;
layout(location = 0) out vec2 vTexCoord;
void main()
{
gl_Position = global.MVP * Position;
vTexCoord = TexCoord * 1.0001;
}
#pragma stage fragment
layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 2) uniform sampler2D OriginalHistory0;
layout(set = 0, binding = 3) uniform sampler2D AvgLumPassFeedback;
// Reference: http://www.compuphase.com/cmetric.htm
// Reference: ScaleFX, author Sp00kyFox
float dist(vec3 A, vec3 B)
{
float r = 0.5 * (A.r + B.r);
vec3 d = A - B;
vec3 c = vec3(2. + r, 4., 3. - r);
return sqrt(dot(c*d, d)) / 3.;
}
void main()
{
float m = max(log2(SourceSize.x), log2(SourceSize.y));