mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-23 00:01:31 +11:00
Merge pull request #85 from Monroe88/auto-box
Add Slang ports of auto-box shaders and update SGB/SGBA/GBP border shader tvout presets to use them
This commit is contained in:
commit
5781223e33
44
auto-box/box-center.slang
Normal file
44
auto-box/box-center.slang
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
#version 450
|
||||||
|
|
||||||
|
/*
|
||||||
|
Box Center Shader
|
||||||
|
Centers pre-scaled output into the viewport, to prevent unintentional non-integer scaling. Maintains 1x scale of the input.
|
||||||
|
Author: Themaister
|
||||||
|
License: Public domain
|
||||||
|
*/
|
||||||
|
|
||||||
|
layout(std140, set = 0, binding = 0) uniform UBO
|
||||||
|
{
|
||||||
|
vec4 SourceSize;
|
||||||
|
vec4 OriginalSize;
|
||||||
|
vec4 OutputSize;
|
||||||
|
uint FrameCount;
|
||||||
|
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;
|
||||||
|
|
||||||
|
vec2 box_scale = vec2(1.0);
|
||||||
|
|
||||||
|
vec2 scale = (global.OutputSize.xy / global.SourceSize.xy) / box_scale;
|
||||||
|
vec2 middle = vec2(0.5);
|
||||||
|
vec2 diff = TexCoord - middle;
|
||||||
|
vTexCoord = middle + diff * scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma stage fragment
|
||||||
|
layout(location = 0) in vec2 vTexCoord;
|
||||||
|
layout(location = 0) out vec4 FragColor;
|
||||||
|
layout(set = 0, binding = 2) uniform sampler2D Source;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
FragColor = vec4(texture(Source, vTexCoord).rgb, 1.0);
|
||||||
|
}
|
54
auto-box/box-max.slang
Normal file
54
auto-box/box-max.slang
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
#version 450
|
||||||
|
|
||||||
|
/*
|
||||||
|
Box Max Shader
|
||||||
|
Automatically scales output to the maximum integer scale possible.
|
||||||
|
Author: Themaister
|
||||||
|
License: Public domain
|
||||||
|
*/
|
||||||
|
|
||||||
|
layout(std140, set = 0, binding = 0) uniform UBO
|
||||||
|
{
|
||||||
|
vec4 SourceSize;
|
||||||
|
vec4 OriginalSize;
|
||||||
|
vec4 OutputSize;
|
||||||
|
uint FrameCount;
|
||||||
|
mat4 MVP;
|
||||||
|
} global;
|
||||||
|
|
||||||
|
#pragma stage vertex
|
||||||
|
layout(location = 0) in vec4 Position;
|
||||||
|
layout(location = 1) in vec2 TexCoord;
|
||||||
|
layout(location = 0) out vec2 vTexCoord;
|
||||||
|
|
||||||
|
|
||||||
|
float min(vec2 x)
|
||||||
|
{
|
||||||
|
if (x.x > x.y)
|
||||||
|
return x.y;
|
||||||
|
else
|
||||||
|
return x.x;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
gl_Position = global.MVP * Position;
|
||||||
|
|
||||||
|
vec2 box_scale = floor(global.OutputSize.xy / global.SourceSize.xy);
|
||||||
|
box_scale = vec2(min(box_scale), min(box_scale));
|
||||||
|
|
||||||
|
vec2 scale = (global.OutputSize.xy / global.SourceSize.xy) / box_scale;
|
||||||
|
vec2 middle = vec2(0.5);
|
||||||
|
vec2 diff = TexCoord - middle;
|
||||||
|
vTexCoord = middle + diff * scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma stage fragment
|
||||||
|
layout(location = 0) in vec2 vTexCoord;
|
||||||
|
layout(location = 0) out vec4 FragColor;
|
||||||
|
layout(set = 0, binding = 2) uniform sampler2D Source;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
FragColor = vec4(texture(Source, vTexCoord).rgb, 1.0);
|
||||||
|
}
|
50
auto-box/box.slang
Normal file
50
auto-box/box.slang
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
#version 450
|
||||||
|
|
||||||
|
/*
|
||||||
|
Box Shader
|
||||||
|
Scales output according to the scale factor parameters.
|
||||||
|
Author: Themaister
|
||||||
|
License: Public domain
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
layout(std140, set = 0, binding = 0) uniform UBO
|
||||||
|
{
|
||||||
|
vec4 SourceSize;
|
||||||
|
vec4 OriginalSize;
|
||||||
|
vec4 OutputSize;
|
||||||
|
uint FrameCount;
|
||||||
|
mat4 MVP;
|
||||||
|
float x_scale;
|
||||||
|
float y_scale;
|
||||||
|
} global;
|
||||||
|
|
||||||
|
#pragma parameter x_scale "X Scale" 3.0 1.0 100.0 1.0
|
||||||
|
#pragma parameter y_scale "Y Scale" 3.0 1.0 100.0 1.0
|
||||||
|
|
||||||
|
#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;
|
||||||
|
|
||||||
|
vec2 box_scale = vec2(global.x_scale, global.y_scale);
|
||||||
|
|
||||||
|
vec2 scale = (global.OutputSize.xy / global.SourceSize.xy) / box_scale;
|
||||||
|
vec2 middle = vec2(0.5);
|
||||||
|
vec2 diff = TexCoord - middle;
|
||||||
|
vTexCoord = middle + diff * scale;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pragma stage fragment
|
||||||
|
layout(location = 0) in vec2 vTexCoord;
|
||||||
|
layout(location = 0) out vec4 FragColor;
|
||||||
|
layout(set = 0, binding = 2) uniform sampler2D Source;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
FragColor = vec4(texture(Source, vTexCoord).rgb, 1.0);
|
||||||
|
}
|
|
@ -1,6 +1,12 @@
|
||||||
|
# Game Boy Player border shader
|
||||||
|
|
||||||
These shader presets will allow you to apply a 608x448 Game Boy Player border around a 240x160 input image from a Game Boy Advance core, with the input being scaled 2x to fit the border.
|
These shader presets will allow you to apply a 608x448 Game Boy Player border around a 240x160 input image from a Game Boy Advance core, with the input being scaled 2x to fit the border.
|
||||||
|
|
||||||
Please note that RetroArch's integer scaling function will not automatically set a correct integer scale for the output image, as it will only take the Game Boy Advance core's reported resolution of 240x160 into account, and not the output image's 608x448 resolution. You will need to set a custom viewport size, either with the Custom Ratio menu option or defining custom_viewport_width and custom_viewport_height in the config file, setting Aspect Ratio Index to "Custom", and enabling Integer Scaling to center the image automatically.
|
Please note that RetroArch's integer scaling function will not automatically set a correct integer scale for the output image, as it will only take the Game Boy Advance core's reported resolution of 240x160 into account, and not the output image's 608x448 resolution.
|
||||||
|
|
||||||
|
One option to display it integer scaled is to set a custom viewport size, either with the Custom Ratio menu option or defining custom_viewport_width and custom_viewport_height in the config file, setting Aspect Ratio Index to "Custom", and enabling Integer Scaling to center the image automatically.
|
||||||
|
|
||||||
|
The other option is to use one of the auto-box shaders in the last pass of the shader chain to integer scale or center the output of the border shader within the viewport. You may need to disable RetroArch's Integer Scaling and set the Aspect Ratio equal to your screen aspect ratio to see the whole image.
|
||||||
|
|
||||||
An example border is included, you can swap it out with another 608x448 Game Boy Player border in png format with the center 240x160 transparent. The borders included with this shader were ripped from a Game Boy Player disc by a kind anonymous user and were edited to appear correct with a GBA image fully shown.
|
An example border is included, you can swap it out with another 608x448 Game Boy Player border in png format with the center 240x160 transparent. The borders included with this shader were ripped from a Game Boy Player disc by a kind anonymous user and were edited to appear correct with a GBA image fully shown.
|
||||||
|
|
|
@ -1,29 +1,32 @@
|
||||||
shaders = "4"
|
shaders = 5
|
||||||
shader0 = "../shaders/imgborder-gbp.slang"
|
shader0 = ../shaders/imgborder-gbp.slang
|
||||||
shader1 = "../../crt/shaders/tvout-tweaks.slang"
|
shader1 = ../../crt/shaders/tvout-tweaks.slang
|
||||||
shader2 = "../../misc/image-adjustment.slang"
|
shader2 = ../../misc/image-adjustment.slang
|
||||||
shader3 = "../../misc/interlacing.slang"
|
shader3 = ../../misc/interlacing.slang
|
||||||
|
shader4 = ../../auto-box/box-center.slang
|
||||||
|
|
||||||
scale_type_x0 = "absolute"
|
scale_type_x0 = absolute
|
||||||
scale_x0 = "608"
|
scale_x0 = 608
|
||||||
scale_type_y0 = "absolute"
|
scale_type_y0 = absolute
|
||||||
scale_y0 = "448"
|
scale_y0 = 448
|
||||||
|
|
||||||
scale_type_x1 = "viewport"
|
scale_type_x1 = viewport
|
||||||
scale_x1 = "1.000000"
|
scale_x1 = 1.000000
|
||||||
scale_type_y1 = "source"
|
scale_type_y1 = source
|
||||||
scale_y1 = "1.000000"
|
scale_y1 = 1.000000
|
||||||
|
|
||||||
parameters = "box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS;enable_480i;top_field_first"
|
filter_linear4 = false
|
||||||
box_scale = "2.000000"
|
|
||||||
location = "0.500000"
|
|
||||||
in_res_x = "240.000000"
|
|
||||||
in_res_y = "160.000000"
|
|
||||||
TVOUT_RESOLUTION = "512.000000"
|
|
||||||
TVOUT_COMPOSITE_CONNECTION = "0.000000"
|
|
||||||
TVOUT_TV_COLOR_LEVELS = "1.000000"
|
|
||||||
enable_480i = "0.000000"
|
|
||||||
top_field_first = "1.000000"
|
|
||||||
|
|
||||||
textures = "BORDER"
|
parameters = box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS;enable_480i;top_field_first
|
||||||
BORDER = "gameboy-player.png"
|
box_scale = 2.000000
|
||||||
|
location = 0.500000
|
||||||
|
in_res_x = 240.000000
|
||||||
|
in_res_y = 160.000000
|
||||||
|
TVOUT_RESOLUTION = 512.000000
|
||||||
|
TVOUT_COMPOSITE_CONNECTION = 0.000000
|
||||||
|
TVOUT_TV_COLOR_LEVELS = 1.000000
|
||||||
|
enable_480i = 1.000000
|
||||||
|
top_field_first = 1.000000
|
||||||
|
|
||||||
|
textures = BORDER
|
||||||
|
BORDER = gameboy-player.png
|
||||||
|
|
|
@ -1,33 +1,39 @@
|
||||||
shaders = "5"
|
shaders = 6
|
||||||
shader0 = "../../handheld/shaders/color/gba-color.slang"
|
shader0 = ../../handheld/shaders/color/gba-color.slang
|
||||||
shader1 = "../shaders/imgborder-gbp.slang"
|
shader1 = ../shaders/imgborder-gbp.slang
|
||||||
shader2 = "../../crt/shaders/tvout-tweaks.slang"
|
shader2 = ../../crt/shaders/tvout-tweaks.slang
|
||||||
shader3 = "../../misc/image-adjustment.slang"
|
shader3 = ../../misc/image-adjustment.slang
|
||||||
shader4 = "../../misc/interlacing.slang"
|
shader4 = ../../misc/interlacing.slang
|
||||||
|
shader5 = ../../auto-box/box-center.slang
|
||||||
|
|
||||||
scale_type0 = "source"
|
scale_type0 = source
|
||||||
scale0 = "1.0"
|
scale0 = 1.0
|
||||||
|
|
||||||
scale_type_x1 = "absolute"
|
scale_type_x1 = absolute
|
||||||
scale_x1 = "608"
|
scale_x1 = 608
|
||||||
scale_type_y1 = "absolute"
|
scale_type_y1 = absolute
|
||||||
scale_y1 = "448"
|
scale_y1 = 448
|
||||||
|
|
||||||
scale_type_x2 = "viewport"
|
scale_type_x2 = viewport
|
||||||
scale_x2 = "1.000000"
|
scale_x2 = 1.000000
|
||||||
scale_type_y2 = "source"
|
scale_type_y2 = source
|
||||||
scale_y2 = "1.000000"
|
scale_y2 = 1.000000
|
||||||
|
|
||||||
parameters = "box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS;enable_480i;top_field_first"
|
scale_type_y4 = source
|
||||||
box_scale = "2.000000"
|
scale_y4 = 1.000000
|
||||||
location = "0.500000"
|
|
||||||
in_res_x = "240.000000"
|
|
||||||
in_res_y = "160.000000"
|
|
||||||
TVOUT_RESOLUTION = "512.000000"
|
|
||||||
TVOUT_COMPOSITE_CONNECTION = "0.000000"
|
|
||||||
TVOUT_TV_COLOR_LEVELS = "0.000000"
|
|
||||||
enable_480i = "0.000000"
|
|
||||||
top_field_first = "1.000000"
|
|
||||||
|
|
||||||
textures = "BORDER"
|
filter_linear5 = false
|
||||||
BORDER = "gameboy-player.png"
|
|
||||||
|
parameters = box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS;enable_480i;top_field_first
|
||||||
|
box_scale = 2.000000
|
||||||
|
location = 0.500000
|
||||||
|
in_res_x = 240.000000
|
||||||
|
in_res_y = 160.000000
|
||||||
|
TVOUT_RESOLUTION = 512.000000
|
||||||
|
TVOUT_COMPOSITE_CONNECTION = 0.000000
|
||||||
|
TVOUT_TV_COLOR_LEVELS = 0.000000
|
||||||
|
enable_480i = 1.000000
|
||||||
|
top_field_first = 1.000000
|
||||||
|
|
||||||
|
textures = BORDER
|
||||||
|
BORDER = gameboy-player.png
|
||||||
|
|
|
@ -1,30 +1,33 @@
|
||||||
shaders = "4"
|
shaders = 5
|
||||||
shader0 = "../../handheld/shaders/color/gba-color.slang"
|
shader0 = ../../handheld/shaders/color/gba-color.slang
|
||||||
shader1 = "../shaders/imgborder-gbp.slang"
|
shader1 = ../shaders/imgborder-gbp.slang
|
||||||
shader2 = "../../crt/shaders/tvout-tweaks.slang"
|
shader2 = ../../crt/shaders/tvout-tweaks.slang
|
||||||
shader3 = "../../misc/image-adjustment.slang"
|
shader3 = ../../misc/image-adjustment.slang
|
||||||
|
shader4 = ../../auto-box/box-center.slang
|
||||||
|
|
||||||
scale_type0 = "source"
|
scale_type0 = source
|
||||||
scale0 = "1.0"
|
scale0 = 1.0
|
||||||
|
|
||||||
scale_type_x1 = "absolute"
|
scale_type_x1 = absolute
|
||||||
scale_x1 = "608"
|
scale_x1 = 608
|
||||||
scale_type_y1 = "absolute"
|
scale_type_y1 = absolute
|
||||||
scale_y1 = "448"
|
scale_y1 = 448
|
||||||
|
|
||||||
scale_type_x2 = "viewport"
|
scale_type_x2 = viewport
|
||||||
scale_x2 = "1.000000"
|
scale_x2 = 1.000000
|
||||||
scale_type_y2 = "source"
|
scale_type_y2 = source
|
||||||
scale_y2 = "1.000000"
|
scale_y2 = 1.000000
|
||||||
|
|
||||||
parameters = "box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS"
|
filter_linear4 = false
|
||||||
box_scale = "2.000000"
|
|
||||||
location = "0.500000"
|
|
||||||
in_res_x = "240.000000"
|
|
||||||
in_res_y = "160.000000"
|
|
||||||
TVOUT_RESOLUTION = "512.000000"
|
|
||||||
TVOUT_COMPOSITE_CONNECTION = "0.000000"
|
|
||||||
TVOUT_TV_COLOR_LEVELS = "0.000000"
|
|
||||||
|
|
||||||
textures = "BORDER"
|
parameters = box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS
|
||||||
BORDER = "gameboy-player.png"
|
box_scale = 2.000000
|
||||||
|
location = 0.500000
|
||||||
|
in_res_x = 240.000000
|
||||||
|
in_res_y = 160.000000
|
||||||
|
TVOUT_RESOLUTION = 512.000000
|
||||||
|
TVOUT_COMPOSITE_CONNECTION = 0.000000
|
||||||
|
TVOUT_TV_COLOR_LEVELS = 0.000000
|
||||||
|
|
||||||
|
textures = BORDER
|
||||||
|
BORDER = gameboy-player.png
|
||||||
|
|
|
@ -1,26 +1,30 @@
|
||||||
shaders = "3"
|
shaders = 4
|
||||||
shader0 = "../shaders/imgborder-gbp.slang"
|
shader0 = ../shaders/imgborder-gbp.slang
|
||||||
shader1 = "../../crt/shaders/tvout-tweaks.slang"
|
shader1 = ../../crt/shaders/tvout-tweaks.slang
|
||||||
shader2 = "../../misc/image-adjustment.slang"
|
shader2 = ../../misc/image-adjustment.slang
|
||||||
|
shader3 = ../../auto-box/box-center.slang
|
||||||
|
|
||||||
scale_type_x0 = "absolute"
|
|
||||||
scale_x0 = "608"
|
|
||||||
scale_type_y0 = "absolute"
|
|
||||||
scale_y0 = "448"
|
|
||||||
|
|
||||||
scale_type_x1 = "viewport"
|
scale_type_x0 = absolute
|
||||||
scale_x1 = "1.000000"
|
scale_x0 = 608
|
||||||
scale_type_y1 = "source"
|
scale_type_y0 = absolute
|
||||||
scale_y1 = "1.000000"
|
scale_y0 = 448
|
||||||
|
|
||||||
parameters = "box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS"
|
scale_type_x1 = viewport
|
||||||
box_scale = "2.000000"
|
scale_x1 = 1.000000
|
||||||
location = "0.500000"
|
scale_type_y1 = source
|
||||||
in_res_x = "240.000000"
|
scale_y1 = 1.000000
|
||||||
in_res_y = "160.000000"
|
|
||||||
TVOUT_RESOLUTION = "480.000000"
|
|
||||||
TVOUT_COMPOSITE_CONNECTION = "0.000000"
|
|
||||||
TVOUT_TV_COLOR_LEVELS = "0.000000"
|
|
||||||
|
|
||||||
textures = "BORDER"
|
filter_linear3 = false
|
||||||
BORDER = "gameboy-player.png"
|
|
||||||
|
parameters = box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS
|
||||||
|
box_scale = 2.000000
|
||||||
|
location = 0.500000
|
||||||
|
in_res_x = 240.000000
|
||||||
|
in_res_y = 160.000000
|
||||||
|
TVOUT_RESOLUTION = 480.000000
|
||||||
|
TVOUT_COMPOSITE_CONNECTION = 0.000000
|
||||||
|
TVOUT_TV_COLOR_LEVELS = 0.000000
|
||||||
|
|
||||||
|
textures = BORDER
|
||||||
|
BORDER = gameboy-player.png
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
|
# Super Game Boy border shader
|
||||||
|
|
||||||
These shader presets will allow you to apply a 256x224 Super Game Boy border around a 160x144 input image from a Game Boy core.
|
These shader presets will allow you to apply a 256x224 Super Game Boy border around a 160x144 input image from a Game Boy core.
|
||||||
|
|
||||||
Please note that RetroArch's integer scaling function will not automatically set a correct integer scale for the output image, as it will only take the Game Boy core's reported resolution of 160x144 into account, and not the output image's 256x224 resolution. You will need to set a custom viewport size, either with the Custom Ratio menu option or defining custom_viewport_width and custom_viewport_height in the config file, setting Aspect Ratio Index to "Custom", and enabling Integer Scaling to center the image automatically.
|
Please note that RetroArch's integer scaling function will not automatically set a correct integer scale for the output image, as it will only take the Game Boy core's reported resolution of 160x144 into account, and not the output image's 256x224 resolution.
|
||||||
|
|
||||||
|
One option to display it integer scaled is to set a custom viewport size, either with the Custom Ratio menu option or defining custom_viewport_width and custom_viewport_height in the config file, setting Aspect Ratio Index to "Custom", and enabling Integer Scaling to center the image automatically.
|
||||||
|
|
||||||
|
The other option is to use one of the auto-box shaders in the last pass of the shader chain to integer scale or center the output of the border shader within the viewport. You may need to disable RetroArch's Integer Scaling and set the Aspect Ratio equal to your screen aspect ratio to see the whole image.
|
||||||
|
|
||||||
An example border is included, you can swap it out with another 256x224 Super Game Boy border in png format with the center 160x144 transparent. Borders derived from an emulator screenshot may be shifted up one pixel and off center, so you would need to shift it down one pixel to center it. The "Super Game Boy Color" borders were created by BLUEamnesiac.
|
An example border is included, you can swap it out with another 256x224 Super Game Boy border in png format with the center 160x144 transparent. Borders derived from an emulator screenshot may be shifted up one pixel and off center, so you would need to shift it down one pixel to center it. The "Super Game Boy Color" borders were created by BLUEamnesiac.
|
|
@ -1,32 +1,38 @@
|
||||||
shaders = "5"
|
shaders = 6
|
||||||
shader0 = "../../handheld/shaders/color/gbc-color.slang"
|
shader0 = ../../handheld/shaders/color/gbc-color.slang
|
||||||
shader1 = "../shaders/imgborder-sgb.slang"
|
shader1 = ../shaders/imgborder-sgb.slang
|
||||||
shader2 = "../../crt/shaders/tvout-tweaks.slang"
|
shader2 = ../../crt/shaders/tvout-tweaks.slang
|
||||||
shader3 = "../../misc/image-adjustment.slang"
|
shader3 = ../../misc/image-adjustment.slang
|
||||||
shader4 = "../../misc/interlacing.slang"
|
shader4 = ../../misc/interlacing.slang
|
||||||
|
shader5 = ../../auto-box/box-center.slang
|
||||||
|
|
||||||
filter_linear0 = false
|
filter_linear0 = false
|
||||||
scale_type_0 = source
|
scale_type_0 = source
|
||||||
scale0 = 1.0
|
scale0 = 1.0
|
||||||
|
|
||||||
scale_type_x1 = "absolute"
|
scale_type_x1 = absolute
|
||||||
scale_x1 = "256"
|
scale_x1 = 256
|
||||||
scale_type_y1 = "absolute"
|
scale_type_y1 = absolute
|
||||||
scale_y1 = "224"
|
scale_y1 = 224
|
||||||
|
|
||||||
scale_type_x2 = "viewport"
|
scale_type_x2 = viewport
|
||||||
scale_x2 = "1.000000"
|
scale_x2 = 1.000000
|
||||||
scale_type_y2 = "source"
|
scale_type_y2 = source
|
||||||
scale_y2 = "1.000000"
|
scale_y2 = 1.000000
|
||||||
|
|
||||||
parameters = "box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS"
|
scale_type_y4 = source
|
||||||
box_scale = "1.000000"
|
scale_y4 = 2.000000
|
||||||
location = "0.500000"
|
|
||||||
in_res_x = "160.000000"
|
|
||||||
in_res_y = "144.000000"
|
|
||||||
TVOUT_RESOLUTION = "320.000000"
|
|
||||||
TVOUT_COMPOSITE_CONNECTION = "0.000000"
|
|
||||||
TVOUT_TV_COLOR_LEVELS = "0.000000"
|
|
||||||
|
|
||||||
textures = "BORDER"
|
filter_linear5 = false
|
||||||
BORDER = "sgb.png"
|
|
||||||
|
parameters = box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS
|
||||||
|
box_scale = 1.000000
|
||||||
|
location = 0.500000
|
||||||
|
in_res_x = 160.000000
|
||||||
|
in_res_y = 144.000000
|
||||||
|
TVOUT_RESOLUTION = 320.000000
|
||||||
|
TVOUT_COMPOSITE_CONNECTION = 0.000000
|
||||||
|
TVOUT_TV_COLOR_LEVELS = 0.000000
|
||||||
|
|
||||||
|
textures = BORDER
|
||||||
|
BORDER = sgb.png
|
||||||
|
|
|
@ -1,27 +1,33 @@
|
||||||
shaders = "4"
|
shaders = 5
|
||||||
shader0 = "../shaders/imgborder-sgb.slang"
|
shader0 = ../shaders/imgborder-sgb.slang
|
||||||
shader1 = "../../crt/shaders/tvout-tweaks.slang"
|
shader1 = ../../crt/shaders/tvout-tweaks.slang
|
||||||
shader2 = "../../misc/image-adjustment.slang"
|
shader2 = ../../misc/image-adjustment.slang
|
||||||
shader3 = "../../misc/interlacing.slang"
|
shader3 = ../../misc/interlacing.slang
|
||||||
|
shader4 = ../../auto-box/box-center.slang
|
||||||
|
|
||||||
scale_type_x0 = "absolute"
|
scale_type_x0 = absolute
|
||||||
scale_x0 = "256"
|
scale_x0 = 256
|
||||||
scale_type_y0 = "absolute"
|
scale_type_y0 = absolute
|
||||||
scale_y0 = "224"
|
scale_y0 = 224
|
||||||
|
|
||||||
scale_type_x1 = "viewport"
|
scale_type_x1 = viewport
|
||||||
scale_x1 = "1.000000"
|
scale_x1 = 1.000000
|
||||||
scale_type_y1 = "source"
|
scale_type_y1 = source
|
||||||
scale_y1 = "1.000000"
|
scale_y1 = 1.000000
|
||||||
|
|
||||||
parameters = "box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS"
|
scale_type_y3 = source
|
||||||
box_scale = "1.000000"
|
scale_y3 = 2.000000
|
||||||
location = "0.500000"
|
|
||||||
in_res_x = "160.000000"
|
|
||||||
in_res_y = "144.000000"
|
|
||||||
TVOUT_RESOLUTION = "320.000000"
|
|
||||||
TVOUT_COMPOSITE_CONNECTION = "0.000000"
|
|
||||||
TVOUT_TV_COLOR_LEVELS = "0.000000"
|
|
||||||
|
|
||||||
textures = "BORDER"
|
filter_linear4 = false
|
||||||
BORDER = "sgb.png"
|
|
||||||
|
parameters = box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS
|
||||||
|
box_scale = 1.000000
|
||||||
|
location = 0.500000
|
||||||
|
in_res_x = 160.000000
|
||||||
|
in_res_y = 144.000000
|
||||||
|
TVOUT_RESOLUTION = 320.000000
|
||||||
|
TVOUT_COMPOSITE_CONNECTION = 0.000000
|
||||||
|
TVOUT_TV_COLOR_LEVELS = 0.000000
|
||||||
|
|
||||||
|
textures = BORDER
|
||||||
|
BORDER = sgb.png
|
||||||
|
|
11
border/sgba/README.md
Normal file
11
border/sgba/README.md
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# Super Game Boy Advance border shader
|
||||||
|
|
||||||
|
These shader presets will allow you to apply a 320x240 Super Game Boy Advance border around a 240x160 input image from a Game Boy Advance core.
|
||||||
|
|
||||||
|
Please note that RetroArch's integer scaling function will not automatically set a correct integer scale for the output image, as it will only take the Game Boy Advance core's reported resolution of 240x160 into account, and not the output image's 320x240 resolution.
|
||||||
|
|
||||||
|
One option to display it integer scaled is to set a custom viewport size, either with the Custom Ratio menu option or defining custom_viewport_width and custom_viewport_height in the config file, setting Aspect Ratio Index to "Custom", and enabling Integer Scaling to center the image automatically.
|
||||||
|
|
||||||
|
The other option is to use one of the auto-box shaders in the last pass of the shader chain to integer scale or center the output of the border shader within the viewport. You may need to disable RetroArch's Integer Scaling and set the Aspect Ratio equal to your screen aspect ratio to see the whole image.
|
||||||
|
|
||||||
|
An example border is included, you can swap it out with another 320x240 Super Game Boy Advance border in png format with the center 240x160 transparent. The borders included with this shader were created by EndUser based on a concept by BLUEamnesiac.
|
|
@ -1,5 +0,0 @@
|
||||||
These shader presets will allow you to apply a 320x240 Super Game Boy Advance border around a 240x160 input image from a Game Boy Advance core.
|
|
||||||
|
|
||||||
Please note that RetroArch's integer scaling function will not automatically set a correct integer scale for the output image, as it will only take the Game Boy Advance core's reported resolution of 240x160 into account, and not the output image's 320x240 resolution. You will need to set a custom viewport size, either with the Custom Ratio menu option or defining custom_viewport_width and custom_viewport_height in the config file, setting Aspect Ratio Index to "Custom", and enabling Integer Scaling to center the image automatically.
|
|
||||||
|
|
||||||
An example border is included, you can swap it out with another 320x240 Super Game Boy Advance border in png format with the center 240x160 transparent. The borders included with this shader were created by EndUser based on a concept by BLUEamnesiac.
|
|
|
@ -1,27 +1,33 @@
|
||||||
shaders = "4"
|
shaders = 5
|
||||||
shader0 = "../shaders/imgborder-sgba.slang"
|
shader0 = ../shaders/imgborder-sgba.slang
|
||||||
shader1 = "../../crt/shaders/tvout-tweaks.slang"
|
shader1 = ../../crt/shaders/tvout-tweaks.slang
|
||||||
shader2 = "../../misc/image-adjustment.slang"
|
shader2 = ../../misc/image-adjustment.slang
|
||||||
shader3 = "../../misc/interlacing.slang"
|
shader3 = ../../misc/interlacing.slang
|
||||||
|
shader4 = ../../auto-box/box-center.slang
|
||||||
|
|
||||||
scale_type_x0 = "absolute"
|
scale_type_x0 = absolute
|
||||||
scale_x0 = "320"
|
scale_x0 = 320
|
||||||
scale_type_y0 = "absolute"
|
scale_type_y0 = absolute
|
||||||
scale_y0 = "240"
|
scale_y0 = 240
|
||||||
|
|
||||||
scale_type_x1 = "viewport"
|
scale_type_x1 = viewport
|
||||||
scale_x1 = "1.000000"
|
scale_x1 = 1.000000
|
||||||
scale_type_y1 = "source"
|
scale_type_y1 = source
|
||||||
scale_y1 = "1.000000"
|
scale_y1 = 1.000000
|
||||||
|
|
||||||
parameters = "box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS"
|
scale_type_y3 = source
|
||||||
box_scale = "1.000000"
|
scale_y3 = 2.000000
|
||||||
location = "0.500000"
|
|
||||||
in_res_x = "240.000000"
|
|
||||||
in_res_y = "160.000000"
|
|
||||||
TVOUT_RESOLUTION = "512.000000"
|
|
||||||
TVOUT_COMPOSITE_CONNECTION = "0.000000"
|
|
||||||
TVOUT_TV_COLOR_LEVELS = "1.000000"
|
|
||||||
|
|
||||||
textures = "BORDER"
|
filter_linear4 = false
|
||||||
BORDER = "sgba.png"
|
|
||||||
|
parameters = box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS
|
||||||
|
box_scale = 1.000000
|
||||||
|
location = 0.500000
|
||||||
|
in_res_x = 240.000000
|
||||||
|
in_res_y = 160.000000
|
||||||
|
TVOUT_RESOLUTION = 512.000000
|
||||||
|
TVOUT_COMPOSITE_CONNECTION = 0.000000
|
||||||
|
TVOUT_TV_COLOR_LEVELS = 1.000000
|
||||||
|
|
||||||
|
textures = BORDER
|
||||||
|
BORDER = sgba.png
|
||||||
|
|
|
@ -1,31 +1,37 @@
|
||||||
shaders = "5"
|
shaders = 6
|
||||||
shader0 = "../../handheld/shaders/color/gba-color.slang"
|
shader0 = ../../handheld/shaders/color/gba-color.slang
|
||||||
shader1 = "../shaders/imgborder-sgba.slang"
|
shader1 = ../shaders/imgborder-sgba.slang
|
||||||
shader2 = "../../crt/shaders/tvout-tweaks.slang"
|
shader2 = ../../crt/shaders/tvout-tweaks.slang
|
||||||
shader3 = "../../misc/image-adjustment.slang"
|
shader3 = ../../misc/image-adjustment.slang
|
||||||
shader4 = "../../misc/interlacing.slang"
|
shader4 = ../../misc/interlacing.slang
|
||||||
|
shader5 = ../../auto-box/box-center.slang
|
||||||
|
|
||||||
scale_type0 = "source"
|
scale_type0 = source
|
||||||
scale0 = "1.0"
|
scale0 = 1.0
|
||||||
|
|
||||||
scale_type_x1 = "absolute"
|
scale_type_x1 = absolute
|
||||||
scale_x1 = "320"
|
scale_x1 = 320
|
||||||
scale_type_y1 = "absolute"
|
scale_type_y1 = absolute
|
||||||
scale_y1 = "240"
|
scale_y1 = 240
|
||||||
|
|
||||||
scale_type_x2 = "viewport"
|
scale_type_x2 = viewport
|
||||||
scale_x2 = "1.000000"
|
scale_x2 = 1.000000
|
||||||
scale_type_y2 = "source"
|
scale_type_y2 = source
|
||||||
scale_y2 = "1.000000"
|
scale_y2 = 1.000000
|
||||||
|
|
||||||
parameters = "box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS"
|
scale_type_y4 = source
|
||||||
box_scale = "1.000000"
|
scale_y4 = 2.000000
|
||||||
location = "0.500000"
|
|
||||||
in_res_x = "240.000000"
|
|
||||||
in_res_y = "160.000000"
|
|
||||||
TVOUT_RESOLUTION = "512.000000"
|
|
||||||
TVOUT_COMPOSITE_CONNECTION = "0.000000"
|
|
||||||
TVOUT_TV_COLOR_LEVELS = "1.000000"
|
|
||||||
|
|
||||||
textures = "BORDER"
|
filter_linear5 = false
|
||||||
BORDER = "sgba.png"
|
|
||||||
|
parameters = box_scale;location;in_res_x;in_res_y;TVOUT_RESOLUTION;TVOUT_COMPOSITE_CONNECTION;TVOUT_TV_COLOR_LEVELS
|
||||||
|
box_scale = 1.000000
|
||||||
|
location = 0.500000
|
||||||
|
in_res_x = 240.000000
|
||||||
|
in_res_y = 160.000000
|
||||||
|
TVOUT_RESOLUTION = 512.000000
|
||||||
|
TVOUT_COMPOSITE_CONNECTION = 0.000000
|
||||||
|
TVOUT_TV_COLOR_LEVELS = 1.000000
|
||||||
|
|
||||||
|
textures = BORDER
|
||||||
|
BORDER = sgba.png
|
||||||
|
|
Loading…
Reference in a new issue