Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro Assets
glsl-shaders
Commits
6ecccacb
Commit
6ecccacb
authored
Feb 10, 2018
by
Monroe88
Browse files
Update gbc-color shader
parent
21067b20
Changes
3
Hide whitespace changes
Inline
Side-by-side
handheld/lcd-grid-v2-gbc-color-motionblur.glslp
View file @
6ecccacb
...
...
@@ -29,4 +29,4 @@ gain = "1.500000"
gamma = "2.200000"
blacklevel = "0.000000"
ambient = "0.000000"
BGR = "
1.0000
00"
BGR = "0
.
0"
handheld/lcd-grid-v2-gbc-color.glslp
View file @
6ecccacb
...
...
@@ -24,4 +24,4 @@ gain = "1.500000"
gamma = "2.200000"
blacklevel = "0.000000"
ambient = "0.000000"
BGR = "
1.0000
00"
BGR = "0
.
0"
handheld/shaders/color/gbc-color.glsl
View file @
6ecccacb
/*
GBC Color Correction Shader
A shader that replicates the LCD dynamics from a Game Boy Color
Color values are derived from Gambatte's color correction implementation.
Color values are derived from Gambatte's color correction implementation
, with some tweaks
.
Based on Color Mangler
Author: hunterk
...
...
@@ -15,19 +15,28 @@
#define COMPAT_PRECISION
#endif
#pragma parameter darken_screen "Darken Screen" 0.0 -0.25 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.0
#endif
#define target_gamma 2.2
#define display_gamma 2.2
#define blr 0.0
#define blg 0.0
#define blb 0.0
#define r 0.78824
#define g 0.72941
#define b 0.
66667
#define rg 0.0
0
#define rb 0.1
8
039
#define b 0.
82
#define rg 0.0
25
#define rb 0.1
2
039
#define gr 0.12157
#define gb 0.12157
#define br 0.0
5882
#define bg 0.2
4314
#define br 0.0
#define bg 0.2
75000
#if defined(VERTEX)
...
...
@@ -107,15 +116,15 @@ COMPAT_VARYING vec4 TEX0;
void
main
()
{
vec4
screen
=
COMPAT_TEXTURE
(
Source
,
vTexCoord
);
// 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.
vec4
screen
=
pow
(
COMPAT_TEXTURE
(
Source
,
vTexCoord
)
,
vec4
(
target_gamma
+
darken_screen
)).
rgba
;
// r
ed
g
reen blue alpha ; alpha does nothing for our purposes
mat4
color
=
mat4
(
r
,
rg
,
rb
,
0
.
0
,
//red
gr
,
g
,
gb
,
0
.
0
,
//green
br
,
bg
,
b
,
0
.
0
,
//blue
blr
,
blg
,
blb
,
0
.
0
);
//black
screen
=
color
*
screen
;
FragColor
=
screen
;
FragColor
=
pow
(
screen
,
vec4
(
1
.
0
/
display_gamma
))
;
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment