make ds-hybrid-view less stupid and add a scalefx preset

This commit is contained in:
hunterk 2018-09-24 20:21:23 -05:00
parent b961d1ad1d
commit 04e4c18c3a
3 changed files with 47 additions and 9 deletions

View file

@ -7,5 +7,7 @@ shader0 = ../sabr/shaders/sabr-v3.0.slang
filter_linear0 = false filter_linear0 = false
scale_type0 = source scale_type0 = source
scale0 = 2.0 scale0 = 2.0
alias0 = Ref
shader1 = shaders/ds-hybrid-view.slang shader1 = shaders/ds-hybrid-view.slang
filter_linear1 = true

View file

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

View file

@ -29,25 +29,26 @@ layout(std140, set = 0, binding = 0) uniform UBO
layout(location = 0) in vec4 Position; layout(location = 0) in vec4 Position;
layout(location = 1) in vec2 TexCoord; layout(location = 1) in vec2 TexCoord;
layout(location = 0) out vec2 vTexCoord; layout(location = 0) out vec2 vTexCoord;
layout(location = 1) out float video_scale;
void main() void main()
{ {
video_scale = floor(params.SourceSize.w * params.OutputSize.y); vec2 video_scale = floor(params.SourceSize.zw * params.OutputSize.xy);
vec2 integer_scale = video_scale * params.SourceSize.xy; vec2 integer_scale = video_scale * params.SourceSize.xy;
gl_Position = (global.MVP * Position); gl_Position = (global.MVP * Position);
vTexCoord = TexCoord * (params.OutputSize.xy / vec2(integer_scale)) * vec2(params.aspect_correction, 1.0); vTexCoord = TexCoord * 1.00001;
vTexCoord *= vec2(1.333,0.5);
} }
#pragma stage fragment #pragma stage fragment
layout(location = 0) in vec2 vTexCoord; layout(location = 0) in vec2 vTexCoord;
layout(location = 1) in float video_scale; layout(location = 1) in float video_scale;
layout(location = 0) out vec4 FragColor; layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 2) uniform sampler2D Source; layout(set = 0, binding = 2) uniform sampler2D Original;
layout(set = 0, binding = 3) uniform sampler2D Source;
void main() void main()
{ {
vec2 bigCoord = vTexCoord * vec2(0.3570) + vec2(0.0, 0.0 + params.screen_toggle); vec2 bigCoord = vTexCoord + vec2(0., 0. + params.screen_toggle);
vec2 smallCoord = vTexCoord * vec2(1.05,1.00) + vec2(-2.94, -0.2); vec2 smallCoord = vTexCoord * vec2(3.) + vec2(-3., 0.);
FragColor = texture(Source, bigCoord) + texture(Source, smallCoord); FragColor = texture(Source, bigCoord) + texture(Original, smallCoord);
} }