-
Notifications
You must be signed in to change notification settings - Fork 6
/
color_daltonize.frag
32 lines (26 loc) · 947 Bytes
/
color_daltonize.frag
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifdef GL_ES
precision mediump float;
#endif
uniform sampler2D u_tex0; // /imgs/danny.png
uniform vec2 u_tex0Resolution;
uniform vec2 u_resolution;
// #define DALTONIZE_FNC daltonizeProtanope
// #define DALTONIZE_FNC daltonizeProtanopia
// #define DALTONIZE_FNC daltonizeProtanomaly
// #define DALTONIZE_FNC daltonizeDeuteranope
// #define DALTONIZE_FNC daltonizeDeuteranopia
#define DALTONIZE_FNC daltonizeDeuteranomaly
// #define DALTONIZE_FNC daltonizeTritanope
// #define DALTONIZE_FNC daltonizeTritanopia
// #define DALTONIZE_FNC daltonizeTritanomaly
// #define DALTONIZE_FNC daltonizeAchromatopsia
// #define DALTONIZE_FNC daltonizeAchromatomaly
#include "lygia/color/daltonize.glsl"
void main (void) {
vec4 color = vec4(0.0, 0.0, 0.0, 1.0);
vec2 pixel = 1.0/u_resolution.xy;
vec2 st = gl_FragCoord.xy * pixel;
vec4 tex0 = texture2D(u_tex0, st);
color = daltonize(tex0);
gl_FragColor = color;
}