From 2cf78f4693ad9fc7ba9ff3fd83ece141a753c5ef Mon Sep 17 00:00:00 2001 From: Tatsuya79 Date: Tue, 25 Jul 2017 19:10:10 +0200 Subject: [PATCH] GB borders new default and additions. --- handheld/console-border/dmg-2x.slangp | 20 +++++++++++++++---- handheld/console-border/dmg-3x.slangp | 20 +++++++++++++++---- handheld/console-border/dmg-4x.slangp | 20 +++++++++++++++---- handheld/console-border/dmg-5x.slangp | 20 +++++++++++++++---- handheld/console-border/dmg-6x.slangp | 20 +++++++++++++++---- handheld/console-border/gb-pocket-2x.slangp | 20 +++++++++++++++---- handheld/console-border/gb-pocket-3x.slangp | 20 +++++++++++++++---- handheld/console-border/gb-pocket-4x.slangp | 20 +++++++++++++++---- handheld/console-border/gb-pocket-5x.slangp | 20 +++++++++++++++---- handheld/console-border/gb-pocket-6x.slangp | 20 +++++++++++++++---- .../gameboy/shader-files/gb-pass0.slang | 6 +++++- 11 files changed, 165 insertions(+), 41 deletions(-) diff --git a/handheld/console-border/dmg-2x.slangp b/handheld/console-border/dmg-2x.slangp index fab24e4..e66a100 100644 --- a/handheld/console-border/dmg-2x.slangp +++ b/handheld/console-border/dmg-2x.slangp @@ -31,17 +31,29 @@ scale4 = 1.0 alias4 = "PASS4" shader5 = shader-files/gb-pass-5.slang +filter_linear5 = true scale_type5 = source scale5 = 1.0 -parameters = "video_scale;SCALE;OUT_X;OUT_Y;adjacent_texel_alpha_blending;pixel_opacity;shadow_opacity;console_border_enable" +parameters = "video_scale;baseline_alpha;response_time;grey_balance;blending_mode;adjacent_texel_alpha_blending;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity;shadow_offset_x;shadow_offset_y;screen_offset_x;screen_offset_y;console_border_enable;SCALE;OUT_X;OUT_Y" video_scale = "3.0" SCALE = "0.6667" OUT_X = "1600.0" OUT_Y = "800.0" -adjacent_texel_alpha_blending = "0.18" -pixel_opacity = "0.90" -shadow_opacity = "0.90" +baseline_alpha = "0.03" +response_time = "0.333" +grey_balance = "3.5" +blending_mode = "0.0" +adjacent_texel_alpha_blending = "0.38" +contrast = "0.8" +screen_light = "0.9" +pixel_opacity = "0.95" +bg_smoothing = "0.0" +shadow_opacity = "0.55" +shadow_offset_x = "-1.5" +shadow_offset_y = "1.5" +screen_offset_x = "0.0" +screen_offset_y = "0.0" console_border_enable = "1.0" textures = COLOR_PALETTE;BACKGROUND;BORDER diff --git a/handheld/console-border/dmg-3x.slangp b/handheld/console-border/dmg-3x.slangp index d867729..c77d6b2 100644 --- a/handheld/console-border/dmg-3x.slangp +++ b/handheld/console-border/dmg-3x.slangp @@ -31,15 +31,27 @@ scale4 = 1.0 alias4 = "PASS4" shader5 = shader-files/gb-pass-5.slang +filter_linear5 = true -parameters = "video_scale;SCALE;OUT_X;OUT_Y;adjacent_texel_alpha_blending;pixel_opacity;shadow_opacity;console_border_enable" +parameters = "video_scale;baseline_alpha;response_time;grey_balance;blending_mode;adjacent_texel_alpha_blending;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity;shadow_offset_x;shadow_offset_y;screen_offset_x;screen_offset_y;console_border_enable;SCALE;OUT_X;OUT_Y" video_scale = "3.0" SCALE = "1.0" OUT_X = "2400.0" OUT_Y = "1200.0" -adjacent_texel_alpha_blending = "0.15" -pixel_opacity = "0.80" -shadow_opacity = "0.80" +baseline_alpha = "0.03" +response_time = "0.333" +grey_balance = "3.5" +blending_mode = "0.0" +adjacent_texel_alpha_blending = "0.38" +contrast = "0.8" +screen_light = "0.9" +pixel_opacity = "0.95" +bg_smoothing = "0.0" +shadow_opacity = "0.55" +shadow_offset_x = "-1.5" +shadow_offset_y = "1.5" +screen_offset_x = "0.0" +screen_offset_y = "0.0" console_border_enable = "1.0" textures = COLOR_PALETTE;BACKGROUND;BORDER diff --git a/handheld/console-border/dmg-4x.slangp b/handheld/console-border/dmg-4x.slangp index e7e03ef..a4f33dd 100644 --- a/handheld/console-border/dmg-4x.slangp +++ b/handheld/console-border/dmg-4x.slangp @@ -31,15 +31,27 @@ scale4 = 1.0 alias4 = "PASS4" shader5 = shader-files/gb-pass-5.slang +filter_linear5 = true -parameters = "video_scale;SCALE;OUT_X;OUT_Y;adjacent_texel_alpha_blending;pixel_opacity;shadow_opacity;console_border_enable" +parameters = "video_scale;baseline_alpha;response_time;grey_balance;blending_mode;adjacent_texel_alpha_blending;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity;shadow_offset_x;shadow_offset_y;screen_offset_x;screen_offset_y;console_border_enable;SCALE;OUT_X;OUT_Y" video_scale = "4.0" SCALE = "1.0" OUT_X = "3200.0" OUT_Y = "1600.0" -adjacent_texel_alpha_blending = "0.14" -pixel_opacity = "0.80" -shadow_opacity = "0.80" +baseline_alpha = "0.03" +response_time = "0.333" +grey_balance = "3.5" +blending_mode = "0.0" +adjacent_texel_alpha_blending = "0.38" +contrast = "0.8" +screen_light = "0.9" +pixel_opacity = "0.95" +bg_smoothing = "0.0" +shadow_opacity = "0.55" +shadow_offset_x = "-1.5" +shadow_offset_y = "1.5" +screen_offset_x = "0.0" +screen_offset_y = "0.0" console_border_enable = "1.0" textures = COLOR_PALETTE;BACKGROUND;BORDER diff --git a/handheld/console-border/dmg-5x.slangp b/handheld/console-border/dmg-5x.slangp index f6c4bd2..3d3aecf 100644 --- a/handheld/console-border/dmg-5x.slangp +++ b/handheld/console-border/dmg-5x.slangp @@ -31,15 +31,27 @@ scale4 = 1.0 alias4 = "PASS4" shader5 = shader-files/gb-pass-5.slang +filter_linear5 = true -parameters = "video_scale;SCALE;OUT_X;OUT_Y;adjacent_texel_alpha_blending;pixel_opacity;shadow_opacity;console_border_enable" +parameters = "video_scale;baseline_alpha;response_time;grey_balance;blending_mode;adjacent_texel_alpha_blending;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity;shadow_offset_x;shadow_offset_y;screen_offset_x;screen_offset_y;console_border_enable;SCALE;OUT_X;OUT_Y" video_scale = "4.0" SCALE = "1.25" OUT_X = "4000.0" OUT_Y = "2000.0" -adjacent_texel_alpha_blending = "0.14" -pixel_opacity = "0.80" -shadow_opacity = "0.80" +baseline_alpha = "0.03" +response_time = "0.333" +grey_balance = "3.5" +blending_mode = "0.0" +adjacent_texel_alpha_blending = "0.38" +contrast = "0.8" +screen_light = "0.9" +pixel_opacity = "0.95" +bg_smoothing = "0.0" +shadow_opacity = "0.55" +shadow_offset_x = "-1.5" +shadow_offset_y = "1.5" +screen_offset_x = "0.0" +screen_offset_y = "0.0" console_border_enable = "1.0" textures = COLOR_PALETTE;BACKGROUND;BORDER diff --git a/handheld/console-border/dmg-6x.slangp b/handheld/console-border/dmg-6x.slangp index 5ca1af8..54cabc6 100644 --- a/handheld/console-border/dmg-6x.slangp +++ b/handheld/console-border/dmg-6x.slangp @@ -31,15 +31,27 @@ scale4 = 1.0 alias4 = "PASS4" shader5 = shader-files/gb-pass-5.slang +filter_linear5 = true -parameters = "video_scale;SCALE;OUT_X;OUT_Y;adjacent_texel_alpha_blending;pixel_opacity;shadow_opacity;console_border_enable" +parameters = "video_scale;baseline_alpha;response_time;grey_balance;blending_mode;adjacent_texel_alpha_blending;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity;shadow_offset_x;shadow_offset_y;screen_offset_x;screen_offset_y;console_border_enable;SCALE;OUT_X;OUT_Y" video_scale = "4.0" SCALE = "1.5" OUT_X = "4800.0" OUT_Y = "2400.0" -adjacent_texel_alpha_blending = "0.14" -pixel_opacity = "0.80" -shadow_opacity = "0.80" +baseline_alpha = "0.03" +response_time = "0.333" +grey_balance = "3.5" +blending_mode = "0.0" +adjacent_texel_alpha_blending = "0.38" +contrast = "0.8" +screen_light = "0.9" +pixel_opacity = "0.95" +bg_smoothing = "0.0" +shadow_opacity = "0.55" +shadow_offset_x = "-1.5" +shadow_offset_y = "1.5" +screen_offset_x = "0.0" +screen_offset_y = "0.0" console_border_enable = "1.0" textures = COLOR_PALETTE;BACKGROUND;BORDER diff --git a/handheld/console-border/gb-pocket-2x.slangp b/handheld/console-border/gb-pocket-2x.slangp index 0f171b8..2cba468 100644 --- a/handheld/console-border/gb-pocket-2x.slangp +++ b/handheld/console-border/gb-pocket-2x.slangp @@ -31,17 +31,29 @@ scale4 = 1.0 alias4 = "PASS4" shader5 = shader-files/gb-pass-5.slang +filter_linear5 = true scale_type5 = source scale5 = 1.0 -parameters = "video_scale;SCALE;OUT_X;OUT_Y;adjacent_texel_alpha_blending;pixel_opacity;shadow_opacity;console_border_enable" +parameters = "video_scale;baseline_alpha;response_time;grey_balance;blending_mode;adjacent_texel_alpha_blending;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity;shadow_offset_x;shadow_offset_y;screen_offset_x;screen_offset_y;console_border_enable;SCALE;OUT_X;OUT_Y" video_scale = "3.0" SCALE = "0.6667" OUT_X = "1600.0" OUT_Y = "800.0" -adjacent_texel_alpha_blending = "0.18" -pixel_opacity = "0.90" -shadow_opacity = "0.90" +baseline_alpha = "0.03" +response_time = "0.333" +grey_balance = "3.5" +blending_mode = "0.0" +adjacent_texel_alpha_blending = "0.38" +contrast = "0.8" +screen_light = "0.9" +pixel_opacity = "0.95" +bg_smoothing = "0.0" +shadow_opacity = "0.55" +shadow_offset_x = "-1.5" +shadow_offset_y = "1.5" +screen_offset_x = "0.0" +screen_offset_y = "0.0" console_border_enable = "1.0" textures = COLOR_PALETTE;BACKGROUND;BORDER diff --git a/handheld/console-border/gb-pocket-3x.slangp b/handheld/console-border/gb-pocket-3x.slangp index 568724b..de103af 100644 --- a/handheld/console-border/gb-pocket-3x.slangp +++ b/handheld/console-border/gb-pocket-3x.slangp @@ -31,15 +31,27 @@ scale4 = 1.0 alias4 = "PASS4" shader5 = shader-files/gb-pass-5.slang +filter_linear5 = true -parameters = "video_scale;SCALE;OUT_X;OUT_Y;adjacent_texel_alpha_blending;pixel_opacity;shadow_opacity;console_border_enable" +parameters = "video_scale;baseline_alpha;response_time;grey_balance;blending_mode;adjacent_texel_alpha_blending;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity;shadow_offset_x;shadow_offset_y;screen_offset_x;screen_offset_y;console_border_enable;SCALE;OUT_X;OUT_Y" video_scale = "3.0" SCALE = "1.0" OUT_X = "2400.0" OUT_Y = "1200.0" -adjacent_texel_alpha_blending = "0.15" -pixel_opacity = "0.80" -shadow_opacity = "0.80" +baseline_alpha = "0.03" +response_time = "0.333" +grey_balance = "3.5" +blending_mode = "0.0" +adjacent_texel_alpha_blending = "0.38" +contrast = "0.8" +screen_light = "0.9" +pixel_opacity = "0.95" +bg_smoothing = "0.0" +shadow_opacity = "0.55" +shadow_offset_x = "-1.5" +shadow_offset_y = "1.5" +screen_offset_x = "0.0" +screen_offset_y = "0.0" console_border_enable = "1.0" textures = COLOR_PALETTE;BACKGROUND;BORDER diff --git a/handheld/console-border/gb-pocket-4x.slangp b/handheld/console-border/gb-pocket-4x.slangp index 3465042..a1d7987 100644 --- a/handheld/console-border/gb-pocket-4x.slangp +++ b/handheld/console-border/gb-pocket-4x.slangp @@ -31,15 +31,27 @@ scale4 = 1.0 alias4 = "PASS4" shader5 = shader-files/gb-pass-5.slang +filter_linear5 = true -parameters = "video_scale;SCALE;OUT_X;OUT_Y;adjacent_texel_alpha_blending;pixel_opacity;shadow_opacity;console_border_enable" +parameters = "video_scale;baseline_alpha;response_time;grey_balance;blending_mode;adjacent_texel_alpha_blending;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity;shadow_offset_x;shadow_offset_y;screen_offset_x;screen_offset_y;console_border_enable;SCALE;OUT_X;OUT_Y" video_scale = "4.0" SCALE = "1.0" OUT_X = "3200.0" OUT_Y = "1600.0" -adjacent_texel_alpha_blending = "0.14" -pixel_opacity = "0.80" -shadow_opacity = "0.80" +baseline_alpha = "0.03" +response_time = "0.333" +grey_balance = "3.5" +blending_mode = "0.0" +adjacent_texel_alpha_blending = "0.38" +contrast = "0.8" +screen_light = "0.9" +pixel_opacity = "0.95" +bg_smoothing = "0.0" +shadow_opacity = "0.55" +shadow_offset_x = "-1.5" +shadow_offset_y = "1.5" +screen_offset_x = "0.0" +screen_offset_y = "0.0" console_border_enable = "1.0" textures = COLOR_PALETTE;BACKGROUND;BORDER diff --git a/handheld/console-border/gb-pocket-5x.slangp b/handheld/console-border/gb-pocket-5x.slangp index e1648ab..45ef1bd 100644 --- a/handheld/console-border/gb-pocket-5x.slangp +++ b/handheld/console-border/gb-pocket-5x.slangp @@ -31,15 +31,27 @@ scale4 = 1.0 alias4 = "PASS4" shader5 = shader-files/gb-pass-5.slang +filter_linear5 = true -parameters = "video_scale;SCALE;OUT_X;OUT_Y;adjacent_texel_alpha_blending;pixel_opacity;shadow_opacity;console_border_enable" +parameters = "video_scale;baseline_alpha;response_time;grey_balance;blending_mode;adjacent_texel_alpha_blending;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity;shadow_offset_x;shadow_offset_y;screen_offset_x;screen_offset_y;console_border_enable;SCALE;OUT_X;OUT_Y" video_scale = "4.0" SCALE = "1.25" OUT_X = "4000.0" OUT_Y = "2000.0" -adjacent_texel_alpha_blending = "0.14" -pixel_opacity = "0.80" -shadow_opacity = "0.80" +baseline_alpha = "0.03" +response_time = "0.333" +grey_balance = "3.5" +blending_mode = "0.0" +adjacent_texel_alpha_blending = "0.38" +contrast = "0.8" +screen_light = "0.9" +pixel_opacity = "0.95" +bg_smoothing = "0.0" +shadow_opacity = "0.55" +shadow_offset_x = "-1.5" +shadow_offset_y = "1.5" +screen_offset_x = "0.0" +screen_offset_y = "0.0" console_border_enable = "1.0" textures = COLOR_PALETTE;BACKGROUND;BORDER diff --git a/handheld/console-border/gb-pocket-6x.slangp b/handheld/console-border/gb-pocket-6x.slangp index ff5b272..ab52455 100644 --- a/handheld/console-border/gb-pocket-6x.slangp +++ b/handheld/console-border/gb-pocket-6x.slangp @@ -31,15 +31,27 @@ scale4 = 1.0 alias4 = "PASS4" shader5 = shader-files/gb-pass-5.slang +filter_linear5 = true -parameters = "video_scale;SCALE;OUT_X;OUT_Y;adjacent_texel_alpha_blending;pixel_opacity;shadow_opacity;console_border_enable" +parameters = "video_scale;baseline_alpha;response_time;grey_balance;blending_mode;adjacent_texel_alpha_blending;contrast;screen_light;pixel_opacity;bg_smoothing;shadow_opacity;shadow_offset_x;shadow_offset_y;screen_offset_x;screen_offset_y;console_border_enable;SCALE;OUT_X;OUT_Y" video_scale = "4.0" SCALE = "1.5" OUT_X = "4800.0" OUT_Y = "2400.0" -adjacent_texel_alpha_blending = "0.14" -pixel_opacity = "0.80" -shadow_opacity = "0.80" +baseline_alpha = "0.03" +response_time = "0.333" +grey_balance = "3.5" +blending_mode = "0.0" +adjacent_texel_alpha_blending = "0.38" +contrast = "0.8" +screen_light = "0.9" +pixel_opacity = "0.95" +bg_smoothing = "0.0" +shadow_opacity = "0.55" +shadow_offset_x = "-1.5" +shadow_offset_y = "1.5" +screen_offset_x = "0.0" +screen_offset_y = "0.0" console_border_enable = "1.0" textures = COLOR_PALETTE;BACKGROUND;BORDER diff --git a/handheld/shaders/gameboy/shader-files/gb-pass0.slang b/handheld/shaders/gameboy/shader-files/gb-pass0.slang index 3df81bd..ee903bc 100644 --- a/handheld/shaders/gameboy/shader-files/gb-pass0.slang +++ b/handheld/shaders/gameboy/shader-files/gb-pass0.slang @@ -7,6 +7,7 @@ layout(push_constant) uniform Push vec4 SourceSize; vec4 OriginalHistorySize1; float baseline_alpha; + float grey_balance; float response_time; float console_border_enable; float video_scale; @@ -25,6 +26,9 @@ layout(std140, set = 0, binding = 0) uniform UBO // Does not affect the border region of the screen - [0, 1] #pragma parameter baseline_alpha "Baseline Alpha" 0.10 0.0 1.0 0.01 +// Fine-tune the balance between the different shades of grey +#pragma parameter grey_balance "Grey Balance" 3.0 2.0 4.0 0.1 + // Simulate response time // Higher values result in longer color transition periods - [0, 1] #pragma parameter response_time "LCD Response Time" 0.333 0.0 0.777 0.111 @@ -148,7 +152,7 @@ void main() input_rgb += (prev5_rgb - input_rgb) * pow(registers.response_time, 6.0); input_rgb += (prev6_rgb - input_rgb) * pow(registers.response_time, 7.0); - float rgb_to_alpha = (input_rgb.r + input_rgb.g + input_rgb.b) * 0.333333333 + float rgb_to_alpha = (input_rgb.r + input_rgb.g + input_rgb.b) / registers.grey_balance + (is_on_dot * registers.baseline_alpha); // Apply foreground color and assign alpha value