-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.glsl
92 lines (65 loc) · 1.75 KB
/
index.glsl
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
vec3 bezier(vec3 A, vec3 B, vec3 C, vec3 D, float t) {
vec3 E = mix(A, B, t);
vec3 F = mix(B, C, t);
vec3 G = mix(C, D, t);
vec3 H = mix(E, F, t);
vec3 I = mix(F, G, t);
vec3 P = mix(H, I, t);
return P;
}
vec3 bezier(vec3 A, vec3 B, vec3 C, vec3 D, vec3 E, float t) {
vec3 A1 = mix(A, B, t);
vec3 B1 = mix(B, C, t);
vec3 C1 = mix(C, D, t);
vec3 D1 = mix(D, E, t);
vec3 A2 = mix(A1, B1, t);
vec3 B2 = mix(B1, C1, t);
vec3 C2 = mix(C1, D1, t);
vec3 A3 = mix(A2, B2, t);
vec3 B3 = mix(B2, C2, t);
vec3 P = mix(A3, B3, t);
return P;
}
vec3 bezier(vec3 A, vec3 B, vec3 C, vec3 D, vec3 E, vec3 F, float t) {
vec3 A1 = mix(A, B, t);
vec3 B1 = mix(B, C, t);
vec3 C1 = mix(C, D, t);
vec3 D1 = mix(D, E, t);
vec3 E1 = mix(E, F, t);
vec3 A2 = mix(A1, B1, t);
vec3 B2 = mix(B1, C1, t);
vec3 C2 = mix(C1, D1, t);
vec3 D2 = mix(D1, E1, t);
vec3 A3 = mix(A2, B2, t);
vec3 B3 = mix(B2, C2, t);
vec3 C3 = mix(C2, D2, t);
vec3 A4 = mix(A3, B3, t);
vec3 B4 = mix(B3, C3, t);
vec3 P = mix(A4, B4, t);
return P;
}
vec3 bezier(vec3 A, vec3 B, vec3 C, vec3 D, vec3 E, vec3 F, vec3 G, float t) {
vec3 A1 = mix(A, B, t);
vec3 B1 = mix(B, C, t);
vec3 C1 = mix(C, D, t);
vec3 D1 = mix(D, E, t);
vec3 E1 = mix(E, F, t);
vec3 F1 = mix(F, G, t);
vec3 A2 = mix(A1, B1, t);
vec3 B2 = mix(B1, C1, t);
vec3 C2 = mix(C1, D1, t);
vec3 D2 = mix(D1, E1, t);
vec3 E2 = mix(E1, F1, t);
vec3 A3 = mix(A2, B2, t);
vec3 B3 = mix(B2, C2, t);
vec3 C3 = mix(C2, D2, t);
vec3 D3 = mix(D2, E2, t);
vec3 A4 = mix(A3, B3, t);
vec3 B4 = mix(B3, C3, t);
vec3 C4 = mix(C3, D3, t);
vec3 A5 = mix(A4, B4, t);
vec3 B5 = mix(B4, C4, t);
vec3 P = mix(A5, B5, t);
return P;
}
#pragma glslify: export(bezier)