update scalefx and presets to allow shaders in front; closes #80

This commit is contained in:
hunterk 2018-12-16 12:16:30 -06:00
parent ba1dbc1e1a
commit b54b0b29df
9 changed files with 105 additions and 79 deletions

View file

@ -1,35 +1,40 @@
// This shader requires 16:9 aspect ratio
// and integer scaling OFF
shaders = 6
shaders = 7
shader0 = ../scalefx/shaders/scalefx-pass0.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0
float_framebuffer0 = true
shader0 = ../stock.slang
alias0 = refpass
filter_linear0 = "false"
shader1 = ../scalefx/shaders/scalefx-pass1.slang
shader1 = ../scalefx/shaders/scalefx-pass0.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
float_framebuffer1 = true
alias1 = scalefx_pass0
shader2 = ../scalefx/shaders/scalefx-pass2.slang
shader2 = ../scalefx/shaders/scalefx-pass1.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
float_framebuffer2 = true
shader3 = ../scalefx/shaders/scalefx-pass3.slang
shader3 = ../scalefx/shaders/scalefx-pass2.slang
filter_linear3 = false
scale_type3 = source
scale3 = 1.0
shader4 = ../scalefx/shaders/scalefx-pass4.slang
shader4 = ../scalefx/shaders/scalefx-pass3.slang
filter_linear4 = false
scale_type4 = source
scale4 = 3.0
alias4 = Ref
scale4 = 1.0
shader5 = shaders/ds-hybrid-view.slang
filter_linear5 = true
shader5 = ../scalefx/shaders/scalefx-pass4.slang
filter_linear5 = false
scale_type5 = source
scale5 = 3.0
alias5 = Ref
shader6 = shaders/ds-hybrid-view.slang
filter_linear6 = true

View file

@ -4,12 +4,14 @@ shader0 = ../windowed/shaders/jinc2.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0
alias0 = refpass
shader1 = ../scalefx/shaders/scalefx-pass0.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
float_framebuffer1 = true
alias1 = scalefx_pass0
shader2 = ../scalefx/shaders/scalefx-pass1.slang
filter_linear2 = false
@ -57,4 +59,4 @@ JINC2_AR_STRENGTH = 0.30
JINC2_WINDOW_SINC = 0.55
JINC2_SINC = 0.95
SFX_SAA = 0.00
SFX_CLR = 0.60
SFX_CLR = 0.60

View file

@ -1,47 +1,51 @@
shaders = 8
shaders = 9
shader0 = ../scalefx/shaders/scalefx-pass0.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0
float_framebuffer0 = true
shader0 = ../stock.slang
alias0 = refpass
shader1 = ../scalefx/shaders/scalefx-pass1.slang
shader1 = ../scalefx/shaders/scalefx-pass0.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
float_framebuffer1 = true
alias1 = scalefx_pass0
shader2 = ../scalefx/shaders/scalefx-pass2.slang
shader2 = ../scalefx/shaders/scalefx-pass1.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
float_framebuffer2 = true
shader3 = ../scalefx/shaders/scalefx-pass3.slang
shader3 = ../scalefx/shaders/scalefx-pass2.slang
filter_linear3 = false
scale_type3 = source
scale3 = 1.0
shader4 = ../scalefx/shaders/scalefx-pass4.slang
shader4 = ../scalefx/shaders/scalefx-pass3.slang
filter_linear4 = false
scale_type4 = source
scale4 = 3.0
scale4 = 1.0
shader5 = ../stock.slang
shader5 = ../scalefx/shaders/scalefx-pass4.slang
filter_linear5 = false
scale_type5 = source
scale5 = 2.0
scale5 = 3.1
shader6 = ../anti-aliasing/shaders/aa-shader-4.0-level2/aa-shader-4.0-level2-pass1.slang
filter_linear6 = true
shader6 = ../stock.slang
filter_linear6 = false
scale_type6 = source
scale6 = 1.0
scale6 = 2.0
shader7 = ../anti-aliasing/shaders/aa-shader-4.0-level2/aa-shader-4.0-level2-pass2.slang
shader7 = ../anti-aliasing/shaders/aa-shader-4.0-level2/aa-shader-4.0-level2-pass1.slang
filter_linear7 = true
scale_type7 = source
scale7 = 1.0
shader8 = ../anti-aliasing/shaders/aa-shader-4.0-level2/aa-shader-4.0-level2-pass2.slang
filter_linear8 = true
scale_type8 = source
scale8 = 1.0
parameters = "SFX_CLR;SFX_SAA"
SFX_SAA = 0.00
SFX_CLR = 0.60
SFX_CLR = 0.60

View file

@ -1,41 +1,46 @@
shaders = 8
shaders = 9
shader0 = shaders/scalefx-pass0.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0
float_framebuffer0 = true
shader0 = ../stock.slang
alias0 = refpass
filter_linear0 = "false"
shader1 = shaders/scalefx-pass1.slang
shader1 = shaders/scalefx-pass0.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
float_framebuffer1 = true
alias1 = scalefx_pass0
shader2 = shaders/scalefx-pass2.slang
shader2 = shaders/scalefx-pass1.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
float_framebuffer2 = true
shader3 = shaders/scalefx-pass3.slang
shader3 = shaders/scalefx-pass2.slang
filter_linear3 = false
scale_type3 = source
scale3 = 1.0
shader4 = shaders/scalefx-pass4.slang
shader4 = shaders/scalefx-pass3.slang
filter_linear4 = false
scale_type4 = source
scale4 = 3.0
scale4 = 1.0
shader5 = ../anti-aliasing/shaders/reverse-aa-post3x/reverse-aa-post3x-pass0.slang
shader5 = shaders/scalefx-pass4.slang
filter_linear5 = false
scale_type5 = source
scale5 = 1.0
scale5 = 3.0
shader6 = ../anti-aliasing/shaders/reverse-aa-post3x/reverse-aa-post3x-pass1.slang
shader6 = ../anti-aliasing/shaders/reverse-aa-post3x/reverse-aa-post3x-pass0.slang
filter_linear6 = false
scale_type6 = source
scale6 = 1.0
shader7 = ../stock.slang
filter_linear7 = true
shader7 = ../anti-aliasing/shaders/reverse-aa-post3x/reverse-aa-post3x-pass1.slang
filter_linear7 = false
scale_type7 = source
scale7 = 1.0
shader8 = ../stock.slang
filter_linear8 = true

View file

@ -1,31 +1,36 @@
shaders = 5
shaders = 6
shader0 = shaders/scalefx-pass0.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0
float_framebuffer0 = true
shader0 = ../stock.slang
alias0 = refpass
filter_linear0 = "false"
shader1 = shaders/scalefx-pass1.slang
shader1 = shaders/scalefx-pass0.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
float_framebuffer1 = true
alias1 = scalefx_pass0
shader2 = shaders/scalefx-pass2.slang
shader2 = shaders/scalefx-pass1.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
float_framebuffer2 = true
shader3 = shaders/scalefx-pass3.slang
shader3 = shaders/scalefx-pass2.slang
filter_linear3 = false
scale_type3 = source
scale3 = 1.0
shader4 = shaders/scalefx-pass4-hybrid.slang
shader4 = shaders/scalefx-pass3.slang
filter_linear4 = false
scale_type4 = source
scale4 = 3.0
scale4 = 1.0
shader5 = shaders/scalefx-pass4-hybrid.slang
filter_linear5 = false
scale_type5 = source
scale5 = 3.0
parameters = "SFX_SAA"
SFX_SAA = "0.0"

View file

@ -1,28 +1,33 @@
shaders = 5
shaders = 6
shader0 = shaders/scalefx-pass0.slang
filter_linear0 = false
scale_type0 = source
scale0 = 1.0
float_framebuffer0 = true
shader0 = ../stock.slang
alias0 = refpass
filter_linear0 = "false"
shader1 = shaders/scalefx-pass1.slang
shader1 = shaders/scalefx-pass0.slang
filter_linear1 = false
scale_type1 = source
scale1 = 1.0
float_framebuffer1 = true
alias1 = scalefx_pass0
shader2 = shaders/scalefx-pass2.slang
shader2 = shaders/scalefx-pass1.slang
filter_linear2 = false
scale_type2 = source
scale2 = 1.0
float_framebuffer2 = true
shader3 = shaders/scalefx-pass3.slang
shader3 = shaders/scalefx-pass2.slang
filter_linear3 = false
scale_type3 = source
scale3 = 1.0
shader4 = shaders/scalefx-pass4.slang
shader4 = shaders/scalefx-pass3.slang
filter_linear4 = false
scale_type4 = source
scale4 = 3.0
scale4 = 1.0
shader5 = shaders/scalefx-pass4.slang
filter_linear5 = false
scale_type5 = source
scale5 = 3.0

View file

@ -60,7 +60,7 @@ layout(location = 0) out vec2 vTexCoord;
void main()
{
gl_Position = global.MVP * Position;
vTexCoord = TexCoord;
vTexCoord = TexCoord*1.0001;;
}
@ -68,7 +68,7 @@ void main()
layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor;
layout(binding = 1) uniform sampler2D Source;
layout(binding = 2) uniform sampler2D PassOutput0;
layout(binding = 2) uniform sampler2D scalefx_pass0;
#define LE(x, y) (1 - step(y, x))
@ -99,7 +99,7 @@ void main()
*/
#define TEXm(x, y) textureOffset(PassOutput0, vTexCoord, ivec2(x, y))
#define TEXm(x, y) textureOffset(scalefx_pass0, vTexCoord, ivec2(x, y))
#define TEXs(x, y) textureOffset(Source, vTexCoord, ivec2(x, y))

View file

@ -73,7 +73,7 @@ void main()
layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor;
layout(binding = 1) uniform sampler2D Source;
layout(binding = 2) uniform sampler2D Original;
layout(binding = 2) uniform sampler2D refpass;
// extract corners
@ -131,7 +131,7 @@ void main()
vec3 res = fp.y == 0 ? (fp.x == 0 ? vec3(crn.x, hc.y, vc.w) : fp.x == 1 ? vec3(mid.x, 0, vm.z) : vec3(crn.y, hc.x, vc.z)) : (fp.y == 1 ? (fp.x == 0 ? vec3(mid.w, hm.y, 0) : fp.x == 1 ? vec3(0) : vec3(mid.y, hm.w, 0)) : (fp.x == 0 ? vec3(crn.w, hc.z, vc.x) : fp.x == 1 ? vec3(mid.z, 0, vm.x) : vec3(crn.z, hc.w, vc.y)));
#define TEX(x, y) textureOffset(Original, vTexCoord, ivec2(x, y)).rgb
#define TEX(x, y) textureOffset(refpass, vTexCoord, ivec2(x, y)).rgb
// reverseAA
vec3 E0 = TEX( 0, 0);
@ -156,4 +156,4 @@ void main()
// hybrid output
FragColor = vec4((res.x != 0) ? sfx : raa, 0);
}
}

View file

@ -70,7 +70,7 @@ void main()
layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor;
layout(binding = 1) uniform sampler2D Source;
layout(binding = 2) uniform sampler2D Original;
layout(binding = 2) uniform sampler2D refpass;
// extract corners
@ -110,5 +110,5 @@ void main()
vec2 res = sp == 0 ? vec2(0,0) : sp == 1 ? vec2(-1,0) : sp == 2 ? vec2(-2,0) : sp == 3 ? vec2(1,0) : sp == 4 ? vec2(2,0) : sp == 5 ? vec2(0,-1) : sp == 6 ? vec2(0,-2) : sp == 7 ? vec2(0,1) : vec2(0,2);
// ouput
FragColor = texture(Original, vTexCoord + res / params.SourceSize.xy);
FragColor = texture(refpass, vTexCoord + res / params.SourceSize.xy);
}