-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcolor_zorn.frag
38 lines (30 loc) · 1.24 KB
/
color_zorn.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
33
34
35
36
37
38
#ifdef GL_ES
precision mediump float;
#endif
uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;
#include "lygia/math/saturate.glsl"
// #define RYB_FAST
// #define RYB_LERP(A, B, T) mix(A, B, T)
#include "lygia/color/mixRYB.glsl"
#include "lygia/color/palette/pigments.glsl"
// #include "lygia/color/palette/pigments/winsor_oil.glsl"
// #include "lygia/color/palette/pigments/winsor_acrylic.glsl"
// #include "lygia/color/palette/pigments/winsor_gouache.glsl"
// #include "lygia/color/palette/pigments/rembrandt_oil.glsl"
// #include "lygia/color/palette/pigments/liquitex_acrylic.glsl"
// #include "lygia/color/palette/pigments/golden_acrylic.glsl"
// #include "lygia/color/palette/pigments/gamblin_oil.glsl"
#include "lygia/color/palette/zorn.glsl"
void main(void) {
vec3 color = vec3(0.0);
vec2 st = gl_FragCoord.xy/u_resolution.xy;
vec4 amounts = vec4(0.0);
amounts.x = saturate(1.0 - length(st - vec2(1.0, 1.0)));
amounts.y = saturate(1.0 - length(st - vec2(0.0, 0.0)));
amounts.z = saturate(1.0 - length(st - vec2(0.0, 1.0)));
amounts.w = saturate(1.0 - length(st - vec2(1.0, 0.0)));
color = mixRYB(zorn(0), zorn(1), zorn(2), zorn(3), amounts);
gl_FragColor = vec4(color, 1.0);
}