diff --git a/handheld/ds-hybrid-sabr.slangp b/handheld/ds-hybrid-sabr.slangp new file mode 100644 index 0000000..cc55bcf --- /dev/null +++ b/handheld/ds-hybrid-sabr.slangp @@ -0,0 +1,11 @@ +// This shader requires 16:9 aspect ratio +// and integer scaling OFF + +shaders = 2 + +shader0 = ../sabr/shaders/sabr-v3.0.slang +filter_linear0 = false +scale_type0 = source +scale0 = 2.0 + +shader1 = shaders/ds-hybrid-view.slang \ No newline at end of file diff --git a/handheld/shaders/ds-hybrid-view.slang b/handheld/shaders/ds-hybrid-view.slang new file mode 100644 index 0000000..f634eea --- /dev/null +++ b/handheld/shaders/ds-hybrid-view.slang @@ -0,0 +1,51 @@ +#version 450 + +// DS Hybrid View +// by hunterk +// license: public domain +// +// This shader requires 16:9 aspect ratio +// and integer scaling OFF + +layout(push_constant) uniform Push +{ + vec4 SourceSize; + vec4 OriginalSize; + vec4 OutputSize; + uint FrameCount; + float screen_toggle; +} params; + +#pragma parameter screen_toggle "Screen Toggle" 0.0 0.0 0.5 0.5 + +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; +layout(location = 1) out float video_scale; + +void main() +{ + video_scale = floor(params.SourceSize.w * params.OutputSize.y); + vec2 integer_scale = video_scale * params.SourceSize.xy; + gl_Position = (global.MVP * Position); + vTexCoord = TexCoord * (params.OutputSize.xy / vec2(integer_scale)); +} + +#pragma stage fragment +layout(location = 0) in vec2 vTexCoord; +layout(location = 1) in float video_scale; +layout(location = 0) out vec4 FragColor; +layout(set = 0, binding = 2) uniform sampler2D Source; + +void main() +{ +vec2 bigCoord = vTexCoord * vec2(0.3570) + vec2(0.0, 0.0 + params.screen_toggle); +vec2 smallCoord = vTexCoord * vec2(1.05) + vec2(-2.942, -0.275); +FragColor = texture(Source, bigCoord) + texture(Source, smallCoord); +} \ No newline at end of file diff --git a/sabr/sabr.slangp b/sabr/sabr.slangp new file mode 100644 index 0000000..0ff46ea --- /dev/null +++ b/sabr/sabr.slangp @@ -0,0 +1,5 @@ +shaders = 1 + +shader0 = shaders/sabr-v3.0.slang +filter_linear0 = false +scale_type_0 = source