diff --git a/handheld/gba-color.slangp b/handheld/gba-color.slangp index 58c2fc4..9c2f9b9 100644 --- a/handheld/gba-color.slangp +++ b/handheld/gba-color.slangp @@ -3,3 +3,4 @@ shaders = 1 shader0 = shaders/color/gba-color.slang filter_linear0 = false scale_type_0 = source +scale0 = 1.0 diff --git a/handheld/lcd-grid-v2-gba-color-motionblur.slangp b/handheld/lcd-grid-v2-gba-color-motionblur.slangp index d3567ef..cc1733b 100644 --- a/handheld/lcd-grid-v2-gba-color-motionblur.slangp +++ b/handheld/lcd-grid-v2-gba-color-motionblur.slangp @@ -5,28 +5,28 @@ filter_linear0 = "false" scale_type0 = "source" scale0 = "1.0" -shader1 = "shaders/color/gba-color.slang" +shader1 = "shaders/lcd-cgwg/lcd-grid-v2.slang" filter_linear1 = "false" -scale_type1 = "source" +scale_type1 = "viewport" scale1 = "1.0" -shader2 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +shader2 = "shaders/color/gba-color.slang" filter_linear2 = "false" -scale_type2 = "viewport" +scale_type2 = "source" 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_R = "0.750000" RSUBPIX_G = "0.000000" RSUBPIX_B = "0.000000" GSUBPIX_R = "0.000000" -GSUBPIX_G = "1.000000" +GSUBPIX_G = "0.750000" 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" +BSUBPIX_B = "0.750000" +gain = "1.500000" +gamma = "2.200000" +blacklevel = "0.000000" ambient = "0.000000" BGR = "1.000000" diff --git a/handheld/lcd-grid-v2-gba-color.slangp b/handheld/lcd-grid-v2-gba-color.slangp index 0713c7b..dd2cd8a 100644 --- a/handheld/lcd-grid-v2-gba-color.slangp +++ b/handheld/lcd-grid-v2-gba-color.slangp @@ -1,27 +1,27 @@ shaders = "2" -shader0 = "shaders/color/gba-color.slang" +shader0 = "shaders/lcd-cgwg/lcd-grid-v2.slang" filter_linear0 = "false" -scale_type0 = "source" +scale_type0 = "viewport" scale0 = "1.0" -shader1 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +shader1 = "shaders/color/gba-color.slang" filter_linear1 = "false" -scale_type1 = "viewport" +scale_type1 = "source" 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_R = "0.750000" RSUBPIX_G = "0.000000" RSUBPIX_B = "0.000000" GSUBPIX_R = "0.000000" -GSUBPIX_G = "1.000000" +GSUBPIX_G = "0.750000" 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" +BSUBPIX_B = "0.750000" +gain = "1.500000" +gamma = "2.200000" +blacklevel = "0.000000" 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 index aa9f076..998d8c2 100644 --- a/handheld/lcd-grid-v2-nds-color-motionblur.slangp +++ b/handheld/lcd-grid-v2-nds-color-motionblur.slangp @@ -5,28 +5,28 @@ filter_linear0 = "false" scale_type0 = "source" scale0 = "1.0" -shader1 = "shaders/color/nds-color.slang" +shader1 = "shaders/lcd-cgwg/lcd-grid-v2.slang" filter_linear1 = "false" -scale_type1 = "source" +scale_type1 = "viewport" scale1 = "1.0" -shader2 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +shader2 = "shaders/color/nds-color.slang" filter_linear2 = "false" -scale_type2 = "viewport" +scale_type2 = "source" 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_R = "0.750000" RSUBPIX_G = "0.000000" RSUBPIX_B = "0.000000" GSUBPIX_R = "0.000000" -GSUBPIX_G = "1.000000" +GSUBPIX_G = "0.750000" 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" +BSUBPIX_B = "0.750000" +gain = "1.500000" +gamma = "2.200000" +blacklevel = "0.000000" ambient = "0.000000" BGR = "1.000000" diff --git a/handheld/lcd-grid-v2-nds-color.slangp b/handheld/lcd-grid-v2-nds-color.slangp index 96c659d..403b2bb 100644 --- a/handheld/lcd-grid-v2-nds-color.slangp +++ b/handheld/lcd-grid-v2-nds-color.slangp @@ -1,27 +1,27 @@ shaders = "2" -shader0 = "shaders/color/nds-color.slang" +shader0 = "shaders/lcd-cgwg/lcd-grid-v2.slang" filter_linear0 = "false" -scale_type0 = "source" +scale_type0 = "viewport" scale0 = "1.0" -shader1 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +shader1 = "shaders/color/nds-color.slang" filter_linear1 = "false" -scale_type1 = "viewport" +scale_type1 = "source" 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_R = "0.750000" RSUBPIX_G = "0.000000" RSUBPIX_B = "0.000000" GSUBPIX_R = "0.000000" -GSUBPIX_G = "1.000000" +GSUBPIX_G = "0.750000" 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" +BSUBPIX_B = "0.750000" +gain = "1.500000" +gamma = "2.200000" +blacklevel = "0.000000" ambient = "0.000000" BGR = "1.000000" diff --git a/handheld/lcd-grid-v2-palm-color-motionblur.slangp b/handheld/lcd-grid-v2-palm-color-motionblur.slangp new file mode 100644 index 0000000..8c01bee --- /dev/null +++ b/handheld/lcd-grid-v2-palm-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/lcd-cgwg/lcd-grid-v2.slang" +filter_linear1 = "false" +scale_type1 = "viewport" +scale1 = "1.0" + +shader2 = "shaders/color/palm-color.slang" +filter_linear2 = "false" +scale_type2 = "source" +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 = "0.750000" +RSUBPIX_G = "0.000000" +RSUBPIX_B = "0.000000" +GSUBPIX_R = "0.000000" +GSUBPIX_G = "0.750000" +GSUBPIX_B = "0.000000" +BSUBPIX_R = "0.000000" +BSUBPIX_G = "0.000000" +BSUBPIX_B = "0.750000" +gain = "1.500000" +gamma = "2.200000" +blacklevel = "0.000000" +ambient = "0.000000" +BGR = "1.000000" diff --git a/handheld/lcd-grid-v2-palm-color.slangp b/handheld/lcd-grid-v2-palm-color.slangp new file mode 100644 index 0000000..901d9e9 --- /dev/null +++ b/handheld/lcd-grid-v2-palm-color.slangp @@ -0,0 +1,27 @@ +shaders = "2" + +shader0 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +filter_linear0 = "false" +scale_type0 = "viewport" +scale0 = "1.0" + +shader1 = "shaders/color/palm-color.slang" +filter_linear1 = "false" +scale_type1 = "source" +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 = "0.750000" +RSUBPIX_G = "0.000000" +RSUBPIX_B = "0.000000" +GSUBPIX_R = "0.000000" +GSUBPIX_G = "0.750000" +GSUBPIX_B = "0.000000" +BSUBPIX_R = "0.000000" +BSUBPIX_G = "0.000000" +BSUBPIX_B = "0.750000" +gain = "1.500000" +gamma = "2.200000" +blacklevel = "0.000000" +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 index 3c286d0..dfedaea 100644 --- a/handheld/lcd-grid-v2-psp-color-motionblur.slangp +++ b/handheld/lcd-grid-v2-psp-color-motionblur.slangp @@ -5,28 +5,28 @@ filter_linear0 = "false" scale_type0 = "source" scale0 = "1.0" -shader1 = "shaders/color/psp-color.slang" +shader1 = "shaders/lcd-cgwg/lcd-grid-v2.slang" filter_linear1 = "false" -scale_type1 = "source" +scale_type1 = "viewport" scale1 = "1.0" -shader2 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +shader2 = "shaders/color/psp-color.slang" filter_linear2 = "false" -scale_type2 = "viewport" +scale_type2 = "source" 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_R = "0.750000" RSUBPIX_G = "0.000000" RSUBPIX_B = "0.000000" GSUBPIX_R = "0.000000" -GSUBPIX_G = "1.000000" +GSUBPIX_G = "0.750000" 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" +BSUBPIX_B = "0.750000" +gain = "1.500000" +gamma = "2.200000" +blacklevel = "0.000000" ambient = "0.000000" BGR = "1.000000" diff --git a/handheld/lcd-grid-v2-psp-color.slangp b/handheld/lcd-grid-v2-psp-color.slangp index 815bb56..0495cc1 100644 --- a/handheld/lcd-grid-v2-psp-color.slangp +++ b/handheld/lcd-grid-v2-psp-color.slangp @@ -1,27 +1,27 @@ shaders = "2" -shader0 = "shaders/color/psp-color.slang" +shader0 = "shaders/lcd-cgwg/lcd-grid-v2.slang" filter_linear0 = "false" -scale_type0 = "source" +scale_type0 = "viewport" scale0 = "1.0" -shader1 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +shader1 = "shaders/color/psp-color.slang" filter_linear1 = "false" -scale_type1 = "viewport" +scale_type1 = "source" 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_R = "0.750000" RSUBPIX_G = "0.000000" RSUBPIX_B = "0.000000" GSUBPIX_R = "0.000000" -GSUBPIX_G = "1.000000" +GSUBPIX_G = "0.750000" 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" +BSUBPIX_B = "0.750000" +gain = "1.500000" +gamma = "2.200000" +blacklevel = "0.000000" 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 index 12c9a5f..a0a42b9 100644 --- a/handheld/lcd-grid-v2-vba-color-motionblur.slangp +++ b/handheld/lcd-grid-v2-vba-color-motionblur.slangp @@ -5,28 +5,28 @@ filter_linear0 = "false" scale_type0 = "source" scale0 = "1.0" -shader1 = "shaders/color/vba-color.slang" +shader1 = "shaders/lcd-cgwg/lcd-grid-v2.slang" filter_linear1 = "false" -scale_type1 = "source" +scale_type1 = "viewport" scale1 = "1.0" -shader2 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +shader2 = "shaders/color/vba-color.slang" filter_linear2 = "false" -scale_type2 = "viewport" +scale_type2 = "source" 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_R = "0.750000" RSUBPIX_G = "0.000000" RSUBPIX_B = "0.000000" GSUBPIX_R = "0.000000" -GSUBPIX_G = "1.000000" +GSUBPIX_G = "0.750000" 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" +BSUBPIX_B = "0.750000" +gain = "1.500000" +gamma = "2.200000" +blacklevel = "0.000000" ambient = "0.000000" BGR = "1.000000" diff --git a/handheld/lcd-grid-v2-vba-color.slangp b/handheld/lcd-grid-v2-vba-color.slangp index 3aa4354..357b642 100644 --- a/handheld/lcd-grid-v2-vba-color.slangp +++ b/handheld/lcd-grid-v2-vba-color.slangp @@ -1,27 +1,27 @@ shaders = "2" -shader0 = "shaders/color/vba-color.slang" +shader0 = "shaders/lcd-cgwg/lcd-grid-v2.slang" filter_linear0 = "false" -scale_type0 = "source" +scale_type0 = "viewport" scale0 = "1.0" -shader1 = "shaders/lcd-cgwg/lcd-grid-v2.slang" +shader1 = "shaders/color/vba-color.slang" filter_linear1 = "false" -scale_type1 = "viewport" +scale_type1 = "source" 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_R = "0.750000" RSUBPIX_G = "0.000000" RSUBPIX_B = "0.000000" GSUBPIX_R = "0.000000" -GSUBPIX_G = "1.000000" +GSUBPIX_G = "0.750000" 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" +BSUBPIX_B = "0.750000" +gain = "1.500000" +gamma = "2.200000" +blacklevel = "0.000000" ambient = "0.000000" BGR = "1.000000" diff --git a/handheld/nds-color.slangp b/handheld/nds-color.slangp index dc19fc9..d912615 100644 --- a/handheld/nds-color.slangp +++ b/handheld/nds-color.slangp @@ -3,3 +3,4 @@ shaders = 1 shader0 = shaders/color/nds-color.slang filter_linear0 = false scale_type_0 = source +scale0 = 1.0 diff --git a/handheld/palm-color.slangp b/handheld/palm-color.slangp new file mode 100644 index 0000000..e1190ad --- /dev/null +++ b/handheld/palm-color.slangp @@ -0,0 +1,6 @@ +shaders = 1 + +shader0 = shaders/color/palm-color.slang +filter_linear0 = false +scale_type_0 = source +scale0 = 1.0 diff --git a/handheld/psp-color.slangp b/handheld/psp-color.slangp index 855873e..5e2996f 100644 --- a/handheld/psp-color.slangp +++ b/handheld/psp-color.slangp @@ -3,3 +3,4 @@ shaders = 1 shader0 = shaders/color/psp-color.slang filter_linear0 = false scale_type_0 = source +scale0 = 1.0 diff --git a/handheld/shaders/color/gba-color.slang b/handheld/shaders/color/gba-color.slang index 45094f6..06b1a05 100644 --- a/handheld/shaders/color/gba-color.slang +++ b/handheld/shaders/color/gba-color.slang @@ -21,25 +21,25 @@ layout(std140, set = 0, binding = 0) uniform UBO */ // Shader that replicates the LCD dynamics from a GameBoy Advance -#pragma parameter darken_screen "Darken Screen" 0.5 0.0 1.0 0.05 +#pragma parameter darken_screen "Darken Screen" 0.5 0.0 2.0 0.05 #define target_gamma 2.2 -#define display_gamma 2.5 +#define display_gamma 2.2 #define sat 1.0 -#define lum 0.99 +#define lum 1.0 #define contrast 1.0 #define blr 0.0 #define blg 0.0 #define blb 0.0 -#define r 0.84 +#define r 0.82 #define g 0.67 #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 rb 0.16 +#define gr 0.24 +#define gb 0.11 +#define br -0.06 +#define bg 0.24 #define overscan_percent_x 0.0 #define overscan_percent_y 0.0 @@ -78,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 / display_gamma + (params.darken_screen / 8))); + FragColor = pow(screen, vec4(1.0 / (display_gamma))); } \ No newline at end of file diff --git a/handheld/shaders/color/nds-color.slang b/handheld/shaders/color/nds-color.slang index 03529a0..f8b851a 100644 --- a/handheld/shaders/color/nds-color.slang +++ b/handheld/shaders/color/nds-color.slang @@ -1,10 +1,5 @@ #version 450 -layout(push_constant) uniform Push -{ - float target_gamma; -} params; - layout(std140, set = 0, binding = 0) uniform UBO { mat4 MVP; @@ -21,24 +16,23 @@ layout(std140, set = 0, binding = 0) uniform UBO */ // Shader that replicates the LCD dynamics from a Nintendo DS Phat -#pragma parameter target_gamma "Gamma Mode" 2.0 2.0 2.4 0.2 - -#define display_gamma 2.20 -#define sat 1.01 +#define target_gamma 2.2 +#define display_gamma 2.2 +#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.74 -#define g 0.63 -#define b 0.74 -#define rg 0.10 +#define r 0.81 +#define g 0.665 +#define b 0.80 +#define rg 0.09 #define rb 0.09 #define gr 0.26 #define gb 0.11 -#define br 0.0 -#define bg 0.27 +#define br -0.07 +#define bg 0.245 #define overscan_percent_x 0.0 #define overscan_percent_y 0.0 @@ -60,7 +54,7 @@ layout(set = 0, binding = 2) uniform sampler2D Source; void main() { - vec4 screen = pow(texture(Source, vTexCoord), vec4(params.target_gamma)).rgba; + vec4 screen = pow(texture(Source, vTexCoord), vec4(target_gamma)).rgba; vec4 avglum = vec4(0.5); screen = mix(screen, avglum, (1.0 - contrast)); diff --git a/handheld/shaders/color/palm-color.slang b/handheld/shaders/color/palm-color.slang new file mode 100644 index 0000000..f9cf416 --- /dev/null +++ b/handheld/shaders/color/palm-color.slang @@ -0,0 +1,82 @@ +#version 450 + +layout(push_constant) uniform Push +{ + float palm_gamma; +} params; + +layout(std140, set = 0, binding = 0) uniform UBO +{ + mat4 MVP; + vec4 OutputSize; + vec4 OriginalSize; + vec4 SourceSize; +} global; + +/* + Shader Modified: Pokefan531 + Color Mangler + Author: hunterk + License: Public domain +*/ +// Shader that replicates the LCD dynamics from Palm OS Phones + +#pragma parameter palm_gamma "Use Palm's Gamma" 0.0 0.0 1.0 1.0 + +#define target_gamma 2.2 +#define display_gamma 2.2 +#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.745 +#define g 0.69 +#define b 0.775 +#define rg 0.06 +#define rb 0.085 +#define gr 0.315 +#define gb 0.14 +#define br -0.06 +#define bg 0.25 +#define overscan_percent_x 0.0 +#define overscan_percent_y 0.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; + vTexCoord = TexCoord; +} + +#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() +{ + vec4 screen = pow(texture(Source, vTexCoord), vec4(target_gamma + (params.palm_gamma * 0.4))).rgba; + vec4 avglum = vec4(0.5); + screen = mix(screen, avglum, (1.0 - contrast)); + + // r g b black +mat4 color = mat4(r, rg, rb, 0.0, //red channel + gr, g, gb, 0.0, //green channel + br, bg, b, 0.0, //blue channel + blr, blg, blb, 0.0); //alpha channel; these numbers do nothing for our purposes. + +mat4 adjust = mat4((1.0 - sat) * 0.3086 + sat, (1.0 - sat) * 0.3086, (1.0 - sat) * 0.3086, 1.0, +(1.0 - sat) * 0.6094, (1.0 - sat) * 0.6094 + sat, (1.0 - sat) * 0.6094, 1.0, +(1.0 - sat) * 0.0820, (1.0 - sat) * 0.0820, (1.0 - sat) * 0.0820 + sat, 1.0, +0.0, 0.0, 0.0, 1.0); + color *= adjust; + screen = clamp(screen * lum, 0.0, 1.0); + screen = color * screen; + FragColor = pow(screen, vec4(1.0 / (display_gamma))); +} \ No newline at end of file diff --git a/handheld/shaders/color/psp-color.slang b/handheld/shaders/color/psp-color.slang index 967fca3..86fb567 100644 --- a/handheld/shaders/color/psp-color.slang +++ b/handheld/shaders/color/psp-color.slang @@ -1,10 +1,5 @@ #version 450 -layout(push_constant) uniform Push -{ - float target_gamma; -} params; - layout(std140, set = 0, binding = 0) uniform UBO { mat4 MVP; @@ -21,8 +16,7 @@ layout(std140, set = 0, binding = 0) uniform UBO */ // 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 target_gamma 2.21 #define display_gamma 2.2 #define sat 1.0 #define lum 1.0 @@ -30,14 +24,14 @@ layout(std140, set = 0, binding = 0) uniform UBO #define blr 0.0 #define blg 0.0 #define blb 0.0 -#define r 0.95 -#define g 0.80 -#define b 0.98 -#define rg 0.03 +#define r 0.92 +#define g 0.795 +#define b 0.975 +#define rg 0.035 #define rb 0.01 -#define gr 0.02 -#define gb 0.01 -#define br 0.0 +#define gr 0.24 +#define gb 0.015 +#define br -0.16 #define bg 0.17 #define overscan_percent_x 0.0 #define overscan_percent_y 0.0 @@ -60,7 +54,7 @@ layout(set = 0, binding = 2) uniform sampler2D Source; void main() { - vec4 screen = pow(texture(Source, vTexCoord), vec4(params.target_gamma)).rgba; + vec4 screen = pow(texture(Source, vTexCoord), vec4(target_gamma)).rgba; vec4 avglum = vec4(0.5); screen = mix(screen, avglum, (1.0 - contrast)); diff --git a/handheld/shaders/color/vba-color.slang b/handheld/shaders/color/vba-color.slang index 9c508b5..d6834b1 100644 --- a/handheld/shaders/color/vba-color.slang +++ b/handheld/shaders/color/vba-color.slang @@ -2,7 +2,7 @@ layout(push_constant) uniform Push { - float target_gamma; + float darken_screen; } params; layout(std140, set = 0, binding = 0) uniform UBO @@ -19,10 +19,11 @@ layout(std140, set = 0, binding = 0) uniform UBO Author: hunterk License: Public domain */ -// Shader that replicates the LCD dynamics from a GameBoy Advance +// Shader that replicates the LCD dynamics from a GameBoy Advance based from VBA-M and No$GBA -#pragma parameter target_gamma "Darken Intensity" 2.9 1.0 2.9 0.05 +#pragma parameter darken_screen "Darken Screen" 1.0 0.0 1.0 0.05 +#define target_gamma 1.45 #define display_gamma 1.45 #define sat 1.0 #define lum 1.0 @@ -60,7 +61,7 @@ layout(set = 0, binding = 2) uniform sampler2D Source; void main() { - vec4 screen = pow(texture(Source, vTexCoord), vec4(params.target_gamma)).rgba; + vec4 screen = pow(texture(Source, vTexCoord), vec4(target_gamma + (params.darken_screen * 1.7))).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 / display_gamma)); + FragColor = pow(screen, vec4(1.0 / (display_gamma))); } \ No newline at end of file diff --git a/handheld/vba-color.slangp b/handheld/vba-color.slangp index 93a05f5..e07626d 100644 --- a/handheld/vba-color.slangp +++ b/handheld/vba-color.slangp @@ -3,3 +3,4 @@ shaders = 1 shader0 = shaders/color/vba-color.slang filter_linear0 = false scale_type_0 = source +scale0 = 1.0 diff --git a/reshade/gba.slangp b/reshade/gba.slangp new file mode 100644 index 0000000..e320dff --- /dev/null +++ b/reshade/gba.slangp @@ -0,0 +1,16 @@ +shaders = 1 + +shader0 = shaders/LUT/LUT.slang +filter_linear0 = "false" +scale_type_x0 = "source" +scale_x0 = "1.000000" +scale_type_y0 = "source" +scale_y0 = "1.000000" + +textures = SamplerLUT + +SamplerLUT = shaders/LUT/GBA.png +SamplerLUT_linear = true + +parameters = "LUT_Size" +LUT_Size = "32.000000" \ No newline at end of file diff --git a/reshade/nds.slangp b/reshade/nds.slangp new file mode 100644 index 0000000..fc3db02 --- /dev/null +++ b/reshade/nds.slangp @@ -0,0 +1,16 @@ +shaders = 1 + +shader0 = shaders/LUT/LUT.slang +filter_linear0 = "false" +scale_type_x0 = "source" +scale_x0 = "1.000000" +scale_type_y0 = "source" +scale_y0 = "1.000000" + +textures = SamplerLUT + +SamplerLUT = shaders/LUT/NDS.png +SamplerLUT_linear = true + +parameters = "LUT_Size" +LUT_Size = "32.000000" \ No newline at end of file diff --git a/reshade/shaders/LUT/GBA.png b/reshade/shaders/LUT/GBA.png new file mode 100644 index 0000000..f159bc8 Binary files /dev/null and b/reshade/shaders/LUT/GBA.png differ diff --git a/reshade/shaders/LUT/NDS.png b/reshade/shaders/LUT/NDS.png new file mode 100644 index 0000000..b8fbf08 Binary files /dev/null and b/reshade/shaders/LUT/NDS.png differ diff --git a/reshade/shaders/LUT/VBA.png b/reshade/shaders/LUT/VBA.png new file mode 100644 index 0000000..75fdeaf Binary files /dev/null and b/reshade/shaders/LUT/VBA.png differ diff --git a/reshade/vba.slangp b/reshade/vba.slangp new file mode 100644 index 0000000..08f378c --- /dev/null +++ b/reshade/vba.slangp @@ -0,0 +1,16 @@ +shaders = 1 + +shader0 = shaders/LUT/LUT.slang +filter_linear0 = "false" +scale_type_x0 = "source" +scale_x0 = "1.000000" +scale_type_y0 = "source" +scale_y0 = "1.000000" + +textures = SamplerLUT + +SamplerLUT = shaders/LUT/VBA.png +SamplerLUT_linear = true + +parameters = "LUT_Size" +LUT_Size = "32.000000" \ No newline at end of file