From 93afc2f8fe20ec1d60333f603d86654f671c3407 Mon Sep 17 00:00:00 2001 From: Monroe88 Date: Thu, 29 Dec 2016 20:05:45 -0600 Subject: [PATCH] Update handheld color shaders to version 8. --- handheld/lcd-grid-v2-gba-color.slangp | 27 ++++++++++++++++ .../lcd-grid-v2-nds-color-motionblur.slangp | 32 +++++++++++++++++++ handheld/lcd-grid-v2-nds-color.slangp | 27 ++++++++++++++++ .../lcd-grid-v2-psp-color-motionblur.slangp | 32 +++++++++++++++++++ handheld/lcd-grid-v2-psp-color.slangp | 27 ++++++++++++++++ .../lcd-grid-v2-vba-color-motionblur.slangp | 32 +++++++++++++++++++ handheld/lcd-grid-v2-vba-color.slangp | 27 ++++++++++++++++ handheld/shaders/color/gba-color.slang | 21 ++++++------ handheld/shaders/color/nds-color.slang | 26 +++++++++------ handheld/shaders/color/psp-color.slang | 26 +++++++++------ 10 files changed, 247 insertions(+), 30 deletions(-) create mode 100644 handheld/lcd-grid-v2-gba-color.slangp create mode 100644 handheld/lcd-grid-v2-nds-color-motionblur.slangp create mode 100644 handheld/lcd-grid-v2-nds-color.slangp create mode 100644 handheld/lcd-grid-v2-psp-color-motionblur.slangp create mode 100644 handheld/lcd-grid-v2-psp-color.slangp create mode 100644 handheld/lcd-grid-v2-vba-color-motionblur.slangp create mode 100644 handheld/lcd-grid-v2-vba-color.slangp diff --git a/handheld/lcd-grid-v2-gba-color.slangp b/handheld/lcd-grid-v2-gba-color.slangp new file mode 100644 index 0000000..0713c7b --- /dev/null +++ b/handheld/lcd-grid-v2-gba-color.slangp @@ -0,0 +1,27 @@ +shaders = "2" + +shader0 = "shaders/color/gba-color.slang" +filter_linear0 = "false" +scale_type0 = "source" +scale0 = "1.0" + +shader1 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +filter_linear1 = "false" +scale_type1 = "viewport" +scale1 = "1.0" + +parameters = "RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR" +RSUBPIX_R = "1.000000" +RSUBPIX_G = "0.000000" +RSUBPIX_B = "0.000000" +GSUBPIX_R = "0.000000" +GSUBPIX_G = "1.000000" +GSUBPIX_B = "0.000000" +BSUBPIX_R = "0.000000" +BSUBPIX_G = "0.000000" +BSUBPIX_B = "1.000000" +gain = "1.250000" +gamma = "3.000000" +blacklevel = "0.050000" +ambient = "0.000000" +BGR = "1.000000" diff --git a/handheld/lcd-grid-v2-nds-color-motionblur.slangp b/handheld/lcd-grid-v2-nds-color-motionblur.slangp new file mode 100644 index 0000000..aa9f076 --- /dev/null +++ b/handheld/lcd-grid-v2-nds-color-motionblur.slangp @@ -0,0 +1,32 @@ +shaders = "3" + +shader0 = "../motionblur/shaders/motionblur-simple.slang" +filter_linear0 = "false" +scale_type0 = "source" +scale0 = "1.0" + +shader1 = "shaders/color/nds-color.slang" +filter_linear1 = "false" +scale_type1 = "source" +scale1 = "1.0" + +shader2 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +filter_linear2 = "false" +scale_type2 = "viewport" +scale2 = "1.0" + +parameters = "RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR" +RSUBPIX_R = "1.000000" +RSUBPIX_G = "0.000000" +RSUBPIX_B = "0.000000" +GSUBPIX_R = "0.000000" +GSUBPIX_G = "1.000000" +GSUBPIX_B = "0.000000" +BSUBPIX_R = "0.000000" +BSUBPIX_G = "0.000000" +BSUBPIX_B = "1.000000" +gain = "1.250000" +gamma = "3.000000" +blacklevel = "0.050000" +ambient = "0.000000" +BGR = "1.000000" diff --git a/handheld/lcd-grid-v2-nds-color.slangp b/handheld/lcd-grid-v2-nds-color.slangp new file mode 100644 index 0000000..96c659d --- /dev/null +++ b/handheld/lcd-grid-v2-nds-color.slangp @@ -0,0 +1,27 @@ +shaders = "2" + +shader0 = "shaders/color/nds-color.slang" +filter_linear0 = "false" +scale_type0 = "source" +scale0 = "1.0" + +shader1 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +filter_linear1 = "false" +scale_type1 = "viewport" +scale1 = "1.0" + +parameters = "RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR" +RSUBPIX_R = "1.000000" +RSUBPIX_G = "0.000000" +RSUBPIX_B = "0.000000" +GSUBPIX_R = "0.000000" +GSUBPIX_G = "1.000000" +GSUBPIX_B = "0.000000" +BSUBPIX_R = "0.000000" +BSUBPIX_G = "0.000000" +BSUBPIX_B = "1.000000" +gain = "1.250000" +gamma = "3.000000" +blacklevel = "0.050000" +ambient = "0.000000" +BGR = "1.000000" diff --git a/handheld/lcd-grid-v2-psp-color-motionblur.slangp b/handheld/lcd-grid-v2-psp-color-motionblur.slangp new file mode 100644 index 0000000..3c286d0 --- /dev/null +++ b/handheld/lcd-grid-v2-psp-color-motionblur.slangp @@ -0,0 +1,32 @@ +shaders = "3" + +shader0 = "../motionblur/shaders/motionblur-simple.slang" +filter_linear0 = "false" +scale_type0 = "source" +scale0 = "1.0" + +shader1 = "shaders/color/psp-color.slang" +filter_linear1 = "false" +scale_type1 = "source" +scale1 = "1.0" + +shader2 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +filter_linear2 = "false" +scale_type2 = "viewport" +scale2 = "1.0" + +parameters = "RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR" +RSUBPIX_R = "1.000000" +RSUBPIX_G = "0.000000" +RSUBPIX_B = "0.000000" +GSUBPIX_R = "0.000000" +GSUBPIX_G = "1.000000" +GSUBPIX_B = "0.000000" +BSUBPIX_R = "0.000000" +BSUBPIX_G = "0.000000" +BSUBPIX_B = "1.000000" +gain = "1.250000" +gamma = "3.000000" +blacklevel = "0.050000" +ambient = "0.000000" +BGR = "1.000000" diff --git a/handheld/lcd-grid-v2-psp-color.slangp b/handheld/lcd-grid-v2-psp-color.slangp new file mode 100644 index 0000000..815bb56 --- /dev/null +++ b/handheld/lcd-grid-v2-psp-color.slangp @@ -0,0 +1,27 @@ +shaders = "2" + +shader0 = "shaders/color/psp-color.slang" +filter_linear0 = "false" +scale_type0 = "source" +scale0 = "1.0" + +shader1 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +filter_linear1 = "false" +scale_type1 = "viewport" +scale1 = "1.0" + +parameters = "RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR" +RSUBPIX_R = "1.000000" +RSUBPIX_G = "0.000000" +RSUBPIX_B = "0.000000" +GSUBPIX_R = "0.000000" +GSUBPIX_G = "1.000000" +GSUBPIX_B = "0.000000" +BSUBPIX_R = "0.000000" +BSUBPIX_G = "0.000000" +BSUBPIX_B = "1.000000" +gain = "1.250000" +gamma = "3.000000" +blacklevel = "0.050000" +ambient = "0.000000" +BGR = "1.000000" diff --git a/handheld/lcd-grid-v2-vba-color-motionblur.slangp b/handheld/lcd-grid-v2-vba-color-motionblur.slangp new file mode 100644 index 0000000..12c9a5f --- /dev/null +++ b/handheld/lcd-grid-v2-vba-color-motionblur.slangp @@ -0,0 +1,32 @@ +shaders = "3" + +shader0 = "../motionblur/shaders/motionblur-simple.slang" +filter_linear0 = "false" +scale_type0 = "source" +scale0 = "1.0" + +shader1 = "shaders/color/vba-color.slang" +filter_linear1 = "false" +scale_type1 = "source" +scale1 = "1.0" + +shader2 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +filter_linear2 = "false" +scale_type2 = "viewport" +scale2 = "1.0" + +parameters = "RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR" +RSUBPIX_R = "1.000000" +RSUBPIX_G = "0.000000" +RSUBPIX_B = "0.000000" +GSUBPIX_R = "0.000000" +GSUBPIX_G = "1.000000" +GSUBPIX_B = "0.000000" +BSUBPIX_R = "0.000000" +BSUBPIX_G = "0.000000" +BSUBPIX_B = "1.000000" +gain = "1.250000" +gamma = "3.000000" +blacklevel = "0.050000" +ambient = "0.000000" +BGR = "1.000000" diff --git a/handheld/lcd-grid-v2-vba-color.slangp b/handheld/lcd-grid-v2-vba-color.slangp new file mode 100644 index 0000000..3aa4354 --- /dev/null +++ b/handheld/lcd-grid-v2-vba-color.slangp @@ -0,0 +1,27 @@ +shaders = "2" + +shader0 = "shaders/color/vba-color.slang" +filter_linear0 = "false" +scale_type0 = "source" +scale0 = "1.0" + +shader1 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +filter_linear1 = "false" +scale_type1 = "viewport" +scale1 = "1.0" + +parameters = "RSUBPIX_R;RSUBPIX_G;RSUBPIX_B;GSUBPIX_R;GSUBPIX_G;GSUBPIX_B;BSUBPIX_R;BSUBPIX_G;BSUBPIX_B;gain;gamma;blacklevel;ambient;BGR" +RSUBPIX_R = "1.000000" +RSUBPIX_G = "0.000000" +RSUBPIX_B = "0.000000" +GSUBPIX_R = "0.000000" +GSUBPIX_G = "1.000000" +GSUBPIX_B = "0.000000" +BSUBPIX_R = "0.000000" +BSUBPIX_G = "0.000000" +BSUBPIX_B = "1.000000" +gain = "1.250000" +gamma = "3.000000" +blacklevel = "0.050000" +ambient = "0.000000" +BGR = "1.000000" diff --git a/handheld/shaders/color/gba-color.slang b/handheld/shaders/color/gba-color.slang index ded2878..45094f6 100644 --- a/handheld/shaders/color/gba-color.slang +++ b/handheld/shaders/color/gba-color.slang @@ -2,7 +2,7 @@ layout(push_constant) uniform Push { - float display_gamma; + float darken_screen; } params; layout(std140, set = 0, binding = 0) uniform UBO @@ -21,22 +21,23 @@ layout(std140, set = 0, binding = 0) uniform UBO */ // Shader that replicates the LCD dynamics from a GameBoy Advance -#pragma parameter display_gamma "Light Intensity" 1.8 1.0 2.5 0.05 +#pragma parameter darken_screen "Darken Screen" 0.5 0.0 1.0 0.05 #define target_gamma 2.2 +#define display_gamma 2.5 #define sat 1.0 -#define lum 1.0 +#define lum 0.99 #define contrast 1.0 #define blr 0.0 #define blg 0.0 #define blb 0.0 #define r 0.84 #define g 0.67 -#define b 0.74 -#define rg 0.08 -#define rb 0.17 -#define gr 0.16 -#define gb 0.09 +#define b 0.73 +#define rg 0.09 +#define rb 0.15 +#define gr 0.18 +#define gb 0.10 #define br 0.0 #define bg 0.26 #define overscan_percent_x 0.0 @@ -60,7 +61,7 @@ layout(set = 0, binding = 2) uniform sampler2D Source; void main() { - vec4 screen = pow(texture(Source, vTexCoord), vec4(target_gamma)).rgba; + vec4 screen = pow(texture(Source, vTexCoord), vec4(target_gamma + params.darken_screen)).rgba; vec4 avglum = vec4(0.5); screen = mix(screen, avglum, (1.0 - contrast)); @@ -77,5 +78,5 @@ mat4 adjust = mat4((1.0 - sat) * 0.3086 + sat, (1.0 - sat) * 0.3086, (1.0 - sat) color *= adjust; screen = clamp(screen * lum, 0.0, 1.0); screen = color * screen; - FragColor = pow(screen, vec4(1.0 / params.display_gamma)); + FragColor = pow(screen, vec4(1.0 / display_gamma + (params.darken_screen / 8))); } \ No newline at end of file diff --git a/handheld/shaders/color/nds-color.slang b/handheld/shaders/color/nds-color.slang index d4d6a33..03529a0 100644 --- a/handheld/shaders/color/nds-color.slang +++ b/handheld/shaders/color/nds-color.slang @@ -1,5 +1,10 @@ #version 450 +layout(push_constant) uniform Push +{ + float target_gamma; +} params; + layout(std140, set = 0, binding = 0) uniform UBO { mat4 MVP; @@ -14,25 +19,26 @@ layout(std140, set = 0, binding = 0) uniform UBO Author: hunterk License: Public domain */ -// Shader that replicates the LCD dynamics from an Original Nintendo DS +// Shader that replicates the LCD dynamics from a Nintendo DS Phat -#define display_gamma 2.25 -#define target_gamma 2.2 -#define sat 1.0 +#pragma parameter target_gamma "Gamma Mode" 2.0 2.0 2.4 0.2 + +#define display_gamma 2.20 +#define sat 1.01 #define lum 1.0 #define contrast 1.0 #define blr 0.0 #define blg 0.0 #define blb 0.0 -#define r 0.77 -#define g 0.65 +#define r 0.74 +#define g 0.63 #define b 0.74 -#define rg 0.09 +#define rg 0.10 #define rb 0.09 -#define gr 0.23 +#define gr 0.26 #define gb 0.11 #define br 0.0 -#define bg 0.26 +#define bg 0.27 #define overscan_percent_x 0.0 #define overscan_percent_y 0.0 @@ -54,7 +60,7 @@ layout(set = 0, binding = 2) uniform sampler2D Source; void main() { - vec4 screen = pow(texture(Source, vTexCoord), vec4(target_gamma)).rgba; + vec4 screen = pow(texture(Source, vTexCoord), vec4(params.target_gamma)).rgba; vec4 avglum = vec4(0.5); screen = mix(screen, avglum, (1.0 - contrast)); diff --git a/handheld/shaders/color/psp-color.slang b/handheld/shaders/color/psp-color.slang index 2c7c052..967fca3 100644 --- a/handheld/shaders/color/psp-color.slang +++ b/handheld/shaders/color/psp-color.slang @@ -1,5 +1,10 @@ #version 450 +layout(push_constant) uniform Push +{ + float target_gamma; +} params; + layout(std140, set = 0, binding = 0) uniform UBO { mat4 MVP; @@ -14,25 +19,26 @@ layout(std140, set = 0, binding = 0) uniform UBO Author: hunterk License: Public domain */ + // Shader that replicates the LCD dynamics from PSP 1000 and PSP 2000 +#pragma parameter target_gamma "Gamma Mode" 2.2 2.2 2.4 0.2 #define display_gamma 2.2 -#define target_gamma 2.21 #define sat 1.0 #define lum 1.0 #define contrast 1.0 #define blr 0.0 #define blg 0.0 #define blb 0.0 -#define r 0.97 -#define g 0.75 -#define b 0.995 -#define rg 0.01 -#define rb 0.0025 -#define gr 0.005 -#define gb 0.0025 +#define r 0.95 +#define g 0.80 +#define b 0.98 +#define rg 0.03 +#define rb 0.01 +#define gr 0.02 +#define gb 0.01 #define br 0.0 -#define bg 0.24 +#define bg 0.17 #define overscan_percent_x 0.0 #define overscan_percent_y 0.0 @@ -54,7 +60,7 @@ layout(set = 0, binding = 2) uniform sampler2D Source; void main() { - vec4 screen = pow(texture(Source, vTexCoord), vec4(target_gamma)).rgba; + vec4 screen = pow(texture(Source, vTexCoord), vec4(params.target_gamma)).rgba; vec4 avglum = vec4(0.5); screen = mix(screen, avglum, (1.0 - contrast));