Unverified Commit 8524a42d authored by hunterk's avatar hunterk Committed by GitHub
Browse files

Add crt-guest-advanced, update other crt-guest, update ntsc-adaptive (#183)

* update crt-guest, add advanced

* re-add some prematurely deleted GDV passes

* fix ntsc res behavior

* disable field-merging on 2-phase to allow MD rainbow artifacting

* remove unused function
parent acd3205c
Pipeline #42089 passed with stage
in 15 seconds
shaders = 8
shaders = 9
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3;SamplerLUT4"
SamplerLUT1 = shaders/guest/advanced/lut/trinitron-lut.png
SamplerLUT1_linear = true
SamplerLUT2 = shaders/guest/advanced/lut/inv-trinitron-lut.png
SamplerLUT2_linear = true
SamplerLUT3 = shaders/guest/advanced/lut/nec-lut.png
SamplerLUT3_linear = true
SamplerLUT4 = shaders/guest/advanced/lut/ntsc-lut.png
SamplerLUT4_linear = true
shader0 = ../stock.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0
alias0 = StockPass
shader1 = ../crt/shaders/guest/crt-gdv-new/afterglow0.slang
shader1 = ../stock.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = AfterglowPass
alias1 = StockPass
shader2 = ../crt/shaders/guest/crt-gdv-new/pre-shaders-afterglow.slang
filter_linear2 = false
shader2 = shaders/guest/fast/pre-shaders.slang
filter_linear2 = true
scale_type2 = source
scale2 = 1.0
alias2 = PrePass
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3;SamplerLUT4"
SamplerLUT1 = ../crt/shaders/guest/lut/sony_trinitron1.png
SamplerLUT1_linear = true
SamplerLUT2 = ../crt/shaders/guest/lut/sony_trinitron2.png
SamplerLUT2_linear = true
SamplerLUT3 = ../crt/shaders/guest/lut/other1.png
SamplerLUT3_linear = true
SamplerLUT4 = ../crt/shaders/guest/lut/custom_lut.png
SamplerLUT4_linear = true
shader3 = ../crt/shaders/guest/crt-gdv-new/avg-lum-ntsc.slang
shader3 = shaders/guest/fast/linearize.slang
filter_linear3 = true
scale_type3 = source
scale3 = 1.0
mipmap_input3 = true
alias3 = AvgLumPass
float_framebuffer3 = true
alias3 = LinearizePass
shader4 = ../crt/shaders/guest/crt-gdv-new/linearize-ntsc.slang
shader4 = shaders/guest/fast/bloom_horizontal.slang
filter_linear4 = true
scale_type4 = source
scale4 = 1.0
alias4 = LinearizePass
float_framebuffer4 = true # comment this line for max precision
scale_type_x4 = absolute
scale_x4 = 800.0
scale_type_y4 = source
scale_y4 = 1.0
float_framebuffer4 = true
shader5 = ../crt/shaders/guest/crt-gdv-new/gaussian_horizontal.slang
shader5 = shaders/guest/fast/bloom_vertical.slang
filter_linear5 = true
scale_type_x5 = viewport
scale_x5 = 0.5
scale_type_x5 = source
scale_x5 = 1.0
scale_type_y5 = source
scale_y5 = 1.0
scale_y5 = 2.0
float_framebuffer5 = true
alias5 = BloomPass
shader6 = ../crt/shaders/guest/crt-gdv-new/gaussian_vertical.slang
shader6 = shaders/guest/fast/crt-guest-advanced-pass1.slang
filter_linear6 = true
scale_type_x6 = viewport
scale_x6 = 0.5
scale_type_y6 = viewport
scale_x6 = 1.0
scale_type_y6 = source
scale_y6 = 0.5
alias6 = GlowPass
float_framebuffer6 = true
shader7 = ../crt/shaders/guest/crt-gdv-new/crt-guest-dr-venom2-hires.slang
shader7 = shaders/guest/fast/crt-guest-advanced-pass2.slang
filter_linear7 = true
scale_type7 = viewport
scale_x7 = 1.0
scale_y7 = 1.0
shader8 = shaders/guest/fast/deconvergence-f.slang
filter_linear8 = true
scale_type8 = viewport
scale_x8 = 1.0
scale_y8 = 1.0
shaders = 4
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3;SamplerLUT4"
SamplerLUT1 = shaders/guest/advanced/lut/trinitron-lut.png
SamplerLUT1_linear = true
SamplerLUT2 = shaders/guest/advanced/lut/inv-trinitron-lut.png
SamplerLUT2_linear = true
SamplerLUT3 = shaders/guest/advanced/lut/nec-lut.png
SamplerLUT3_linear = true
SamplerLUT4 = shaders/guest/advanced/lut/ntsc-lut.png
SamplerLUT4_linear = true
shader0 = shaders/guest/fast/pre-shadersf.slang
filter_linear0 = true
scale_type0 = source
scale0 = 1.0
alias0 = PrePassDontChange
shader1 = shaders/guest/fast/linearizef.slang
filter_linear1 = true
scale_type1 = source
scale1 = 1.0
float_framebuffer1 = true
alias1 = LinearizePass
shader2 = shaders/guest/fast/crt-guest-advanced-pass1f.slang
filter_linear2 = true
scale_type_x2 = viewport
scale_x2 = 1.0
scale_type_y2 = source
scale_y2 = 1.0
float_framebuffer2 = true
shader3 = shaders/guest/fast/crt-guest-advanced-pass2f.slang
filter_linear3 = true
scale_type3 = viewport
scale_x3 = 1.0
scale_y3 = 1.0
alias3 = Pass2
shaders = 10
shader0 = ../stock.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0
shader1 = ../stock.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = StockPass
shader2 = shaders/guest/advanced/afterglow0.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
alias2 = AfterglowPass
shader3 = shaders/guest/advanced/pre-shaders-afterglow.slang
filter_linear3 = false
scale_type3 = source
scale3 = 1.0
mipmap_input3 = true
alias3 = PrePass
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3;SamplerLUT4"
SamplerLUT1 = shaders/guest/advanced/lut/trinitron-lut.png
SamplerLUT1_linear = true
SamplerLUT2 = shaders/guest/advanced/lut/inv-trinitron-lut.png
SamplerLUT2_linear = true
SamplerLUT3 = shaders/guest/advanced/lut/nec-lut.png
SamplerLUT3_linear = true
SamplerLUT4 = shaders/guest/advanced/lut/ntsc-lut.png
SamplerLUT4_linear = true
shader4 = shaders/guest/advanced/avg-lum-hires.slang
filter_linear4 = true
scale_type4 = source
scale4 = 1.0
mipmap_input4 = true
alias4 = AvgLumPass
shader5 = shaders/guest/advanced/linearize-hires.slang
filter_linear5 = true
scale_type5 = source
scale5 = 1.0
alias5 = LinearizePass
float_framebuffer5 = true
shader6 = shaders/guest/advanced/bloom_horizontal_ntsc.slang
filter_linear6 = true
scale_type_x6 = absolute
scale_x6 = 800.0
scale_type_y6 = source
scale_y6 = 1.0
float_framebuffer6 = true
shader7 = shaders/guest/advanced/bloom_vertical_ntsc.slang
filter_linear7 = true
scale_type_x7 = absolute
scale_x7 = 800.0
scale_type_y7 = absolute
scale_y7 = 600.0
float_framebuffer7 = true
alias7 = GlowPass
shader8 = shaders/guest/advanced/crt-guest-advanced-hires.slang
filter_linear8 = true
scale_type8 = viewport
scale_x8 = 1.0
scale_y8 = 1.0
shader9 = shaders/guest/advanced/deconvergence.slang
filter_linear9 = true
scale_type9 = viewport
scale_x9 = 1.0
scale_y9 = 1.0
shaders = 12
shader0 = ../stock.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0
shader1 = ../stock.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
alias1 = StockPass
shader2 = shaders/guest/advanced/afterglow0.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
alias2 = AfterglowPass
shader3 = shaders/guest/advanced/pre-shaders-afterglow.slang
filter_linear3 = false
scale_type3 = source
mipmap_input3 = true
scale3 = 1.0
alias3 = PrePass
textures = "SamplerLUT1;SamplerLUT2;SamplerLUT3;SamplerLUT4"
SamplerLUT1 = shaders/guest/advanced/lut/trinitron-lut.png
SamplerLUT1_linear = true
SamplerLUT2 = shaders/guest/advanced/lut/inv-trinitron-lut.png
SamplerLUT2_linear = true
SamplerLUT3 = shaders/guest/advanced/lut/nec-lut.png
SamplerLUT3_linear = true
SamplerLUT4 = shaders/guest/advanced/lut/ntsc-lut.png
SamplerLUT4_linear = true
shader4 = shaders/guest/advanced/avg-lum.slang
filter_linear4 = true
scale_type4 = source
scale4 = 1.0
mipmap_input4 = true
alias4 = AvgLumPass
shader5 = shaders/guest/advanced/linearize.slang
filter_linear5 = true
scale_type5 = source
scale5 = 1.0
alias5 = LinearizePass
float_framebuffer5 = true
shader6 = shaders/guest/advanced/gaussian_horizontal.slang
filter_linear6 = true
scale_type_x6 = absolute
scale_x6 = 800.0
scale_type_y6 = source
scale_y6 = 1.0
float_framebuffer6 = true
shader7 = shaders/guest/advanced/gaussian_vertical.slang
filter_linear7 = true
scale_type_x7 = absolute
scale_x7 = 800.0
scale_type_y7 = absolute
scale_y7 = 600.0
float_framebuffer7 = true
alias7 = GlowPass
shader8 = shaders/guest/advanced/bloom_horizontal.slang
filter_linear8 = true
scale_type_x8 = absolute
scale_x8 = 800.0
scale_type_y8 = absolute
scale_y8 = 600.0
float_framebuffer8 = true
shader9 = shaders/guest/advanced/bloom_vertical.slang
filter_linear9 = true
scale_type_x9 = source
scale_x9 = 1.0
scale_type_y9 = source
scale_y9 = 1.0
float_framebuffer9 = true
alias9 = BloomPass
shader10 = shaders/guest/advanced/crt-guest-advanced.slang
filter_linear10 = true
scale_type10 = viewport
scale_x10 = 1.0
scale_y10 = 1.0
shader11 = shaders/guest/advanced/deconvergence.slang
filter_linear11 = true
scale_type11 = viewport
scale_x11 = 1.0
scale_y11 = 1.0
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
#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.25 0.0 0.50 0.01
#pragma parameter PG " Persistence Green" 0.25 0.0 0.50 0.01
#pragma parameter PB " Persistence Blue" 0.25 0.0 0.50 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 < 1.5/255.0)) { w = 0.0; }
vec3 result = mix( max(mix(color, accumulate, 0.49 + vec3(PR, PG, PB))- 3.0/255.0, 0.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.70 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 PrePass;
layout(set = 0, binding = 3) uniform sampler2D AvgLumPassFeedback;
void main()
{
if (vTexCoord.x > 0.2 || vTexCoord.y > 0.2) discard;
float m = max(log2(SourceSize.x), log2(SourceSize.y));
m = floor(max(m, 1.0));
float ltotal = 0.0;
ltotal+= length(textureLod(PrePass, vec2(0.25, 0.25), m).rgb);
ltotal+= length(textureLod(PrePass, vec2(0.25, 0.75), m).rgb);
ltotal+= length(textureLod(PrePass, vec2(0.75, 0.25), m).rgb);
ltotal+= length(textureLod(PrePass, vec2(0.75, 0.75), m).rgb);
ltotal*=0.25;
ltotal = pow(0.577350269 * ltotal, 0.65);
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.70 0.50 0.99 0.01
#define lsmooth params.lsmooth
#define COMPAT_TEXTURE(c,d) texture(c,d)
#define SourceSize params.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 Source;
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);