Commit 45a027d7 authored by Monroe88's avatar Monroe88
Browse files

Update handheld color shaders to version 9.0

parent 605a2f7f
......@@ -3,3 +3,4 @@ shaders = 1
shader0 = shaders/color/gba-color.glsl
filter_linear0 = false
scale_type_0 = source
scale0 = 1.0
......@@ -5,28 +5,28 @@ filter_linear0 = "false"
scale_type0 = "source"
scale0 = "1.0"
shader1 = "shaders/color/gba-color.glsl"
shader1 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
filter_linear1 = "false"
scale_type1 = "source"
scale_type1 = "viewport"
scale1 = "1.0"
shader2 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
shader2 = "shaders/color/gba-color.glsl"
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"
shaders = "2"
shader0 = "shaders/color/gba-color.glsl"
shader0 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
filter_linear0 = "false"
scale_type0 = "source"
scale_type0 = "viewport"
scale0 = "1.0"
shader1 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
shader1 = "shaders/color/gba-color.glsl"
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"
......@@ -5,28 +5,28 @@ filter_linear0 = "false"
scale_type0 = "source"
scale0 = "1.0"
shader1 = "shaders/color/nds-color.glsl"
shader1 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
filter_linear1 = "false"
scale_type1 = "source"
scale_type1 = "viewport"
scale1 = "1.0"
shader2 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
shader2 = "shaders/color/nds-color.glsl"
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"
shaders = "2"
shader0 = "shaders/color/nds-color.glsl"
shader0 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
filter_linear0 = "false"
scale_type0 = "source"
scale_type0 = "viewport"
scale0 = "1.0"
shader1 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
shader1 = "shaders/color/nds-color.glsl"
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"
shaders = "3"
shader0 = "../motionblur/shaders/motionblur-simple.glsl"
filter_linear0 = "false"
scale_type0 = "source"
scale0 = "1.0"
shader1 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
filter_linear1 = "false"
scale_type1 = "viewport"
scale1 = "1.0"
shader2 = "shaders/color/palm-color.glsl"
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"
shaders = "2"
shader0 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
filter_linear0 = "false"
scale_type0 = "viewport"
scale0 = "1.0"
shader1 = "shaders/color/palm-color.glsl"
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"
......@@ -5,28 +5,28 @@ filter_linear0 = "false"
scale_type0 = "source"
scale0 = "1.0"
shader1 = "shaders/color/psp-color.glsl"
shader1 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
filter_linear1 = "false"
scale_type1 = "source"
scale_type1 = "viewport"
scale1 = "1.0"
shader2 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
shader2 = "shaders/color/psp-color.glsl"
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"
shaders = "2"
shader0 = "shaders/color/psp-color.glsl"
shader0 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
filter_linear0 = "false"
scale_type0 = "source"
scale_type0 = "viewport"
scale0 = "1.0"
shader1 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
shader1 = "shaders/color/psp-color.glsl"
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"
......@@ -5,28 +5,28 @@ filter_linear0 = "false"
scale_type0 = "source"
scale0 = "1.0"
shader1 = "shaders/color/vba-color.glsl"
shader1 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
filter_linear1 = "false"
scale_type1 = "source"
scale_type1 = "viewport"
scale1 = "1.0"
shader2 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
shader2 = "shaders/color/vba-color.glsl"
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"
shaders = "2"
shader0 = "shaders/color/vba-color.glsl"
shader0 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
filter_linear0 = "false"
scale_type0 = "source"
scale_type0 = "viewport"
scale0 = "1.0"
shader1 = "shaders/lcd-cgwg/lcd-grid-v2.glsl"
shader1 = "shaders/color/vba-color.glsl"
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"
shaders = 5
shader0 = shaders/lcd-shader/lcd-pass-0.glsl
shader1 = shaders/lcd-shader/lcd-pass-1.glsl
shader2 = shaders/lcd-shader/lcd-pass-2.glsl
shader3 = shaders/lcd-shader/lcd-pass-3.glsl
shader4 = shaders/color/gba-color.glsl
scale_type0 = viewport
scale0 = 1
scale_type1 = source
scale1 = 1
scale_type2 = source
scale2 = 1
scale_type3 = source
scale3 = 1
scale_type4 = source
scale4 = 1
filter_linear0 = false
filter_linear1 = false
filter_linear2 = false
filter_linear3 = false
filter_linear4 = false
textures = BACKGROUND
BACKGROUND = shaders/lcd-shader/background.png
BACKGROUND_linear = true
parameters = "display_gamma"
display_gamma = "2.200000"
\ No newline at end of file
shaders = 5
shader0 = shaders/lcd-shader/lcd-pass-0.glsl
shader1 = shaders/lcd-shader/lcd-pass-1.glsl
shader2 = shaders/lcd-shader/lcd-pass-2.glsl
shader3 = shaders/lcd-shader/lcd-pass-3.glsl
shader4 = shaders/color/nds-color.glsl
scale_type0 = viewport
scale0 = 1
scale_type1 = source
scale1 = 1
scale_type2 = source
scale2 = 1
scale_type3 = source
scale3 = 1
scale_type4 = source
scale4 = 1
filter_linear0 = false
filter_linear1 = false
filter_linear2 = false
filter_linear3 = false
filter_linear4 = false
textures = BACKGROUND
BACKGROUND = shaders/lcd-shader/background.png
BACKGROUND_linear = true
\ No newline at end of file
shaders = 5
shader0 = shaders/lcd-shader/lcd-pass-0.glsl
shader1 = shaders/lcd-shader/lcd-pass-1.glsl
shader2 = shaders/lcd-shader/lcd-pass-2.glsl
shader3 = shaders/lcd-shader/lcd-pass-3.glsl
shader4 = shaders/color/palm-color.glsl
scale_type0 = viewport
scale0 = 1
scale_type1 = source
scale1 = 1
scale_type2 = source
scale2 = 1
scale_type3 = source
scale3 = 1
scale_type4 = source
scale4 = 1
filter_linear0 = false
filter_linear1 = false
filter_linear2 = false
filter_linear3 = false
filter_linear4 = false
textures = BACKGROUND
BACKGROUND = shaders/lcd-shader/background.png
BACKGROUND_linear = true
parameters = "display_gamma"
display_gamma = "2.200000"
\ No newline at end of file
shaders = 5
shader0 = shaders/lcd-shader/lcd-pass-0.glsl
shader1 = shaders/lcd-shader/lcd-pass-1.glsl
shader2 = shaders/lcd-shader/lcd-pass-2.glsl
shader3 = shaders/lcd-shader/lcd-pass-3.glsl
shader4 = shaders/color/psp-color.glsl
scale_type0 = viewport
scale0 = 1
scale_type1 = source
scale1 = 1
scale_type2 = source
scale2 = 1
scale_type3 = source
scale3 = 1
scale_type4 = source
scale4 = 1
filter_linear0 = false
filter_linear1 = false
filter_linear2 = false
filter_linear3 = false
filter_linear4 = false
textures = BACKGROUND
BACKGROUND = shaders/lcd-shader/background.png
BACKGROUND_linear = true
parameters = "display_gamma"
display_gamma = "2.200000"
\ No newline at end of file
shaders = 5
shader0 = shaders/lcd-shader/lcd-pass-0.glsl
shader1 = shaders/lcd-shader/lcd-pass-1.glsl
shader2 = shaders/lcd-shader/lcd-pass-2.glsl
shader3 = shaders/lcd-shader/lcd-pass-3.glsl
shader4 = shaders/color/vba-color.glsl
scale_type0 = viewport
scale0 = 1
scale_type1 = source
scale1 = 1
scale_type2 = source
scale2 = 1
scale_type3 = source
scale3 = 1
scale_type4 = source
scale4 = 1
filter_linear0 = false
filter_linear1 = false
filter_linear2 = false
filter_linear3 = false
filter_linear4 = false
textures = BACKGROUND
BACKGROUND = shaders/lcd-shader/background.png
BACKGROUND_linear = true
\ No newline at end of file
......@@ -3,3 +3,4 @@ shaders = 1
shader0 = shaders/color/nds-color.glsl
filter_linear0 = false
scale_type_0 = source
scale0 = 1.0
shaders = 1
shader0 = shaders/color/palm-color.glsl
filter_linear0 = false
scale_type_0 = source
scale0 = 1.0
......@@ -3,3 +3,4 @@ shaders = 1
shader0 = shaders/color/psp-color.glsl
filter_linear0 = false
scale_type_0 = source
scale0 = 1.0
......@@ -6,26 +6,39 @@
*/
// Shader that replicates the LCD dynamics from a GameBoy Advance
// Compatibility #ifdefs needed for parameters
#ifdef GL_ES
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif
// Parameter lines go here:
#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
#ifdef PARAMETER_UNIFORM
// All parameter floats need to have COMPAT_PRECISION in front of them
uniform COMPAT_PRECISION float darken_screen;
#else
#define darken_screen 0.6
#endif
#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
......@@ -105,12 +118,6 @@ COMPAT_VARYING vec4 TEX0;
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define outsize vec4(OutputSize, 1.0 / OutputSize)
#ifdef PARAMETER_UNIFORM
uniform COMPAT_PRECISION float darken_screen;
#else
#define darken_screen 0.5
#endif
void main()
{
vec4 screen = pow(texture(Source, vTexCoord), vec4(target_gamma + darken_screen)).rgba;
......@@ -130,6 +137,6 @@ 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 + (darken_screen / 8.)));
FragColor = pow(screen, vec4(1.0 / display_gamma));
}
#endif