-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrotate ctrl.fs
95 lines (89 loc) · 2.18 KB
/
rotate ctrl.fs
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
93
94
95
/*{
"DESCRIPTION": "rotate control",
"CREDIT": "kaleidope.de",
"CATEGORIES": [
"mind expansion"
],
"INPUTS": [
{
"NAME": "iChannel0",
"TYPE": "image"
},
{
"NAME": "swag1",
"TYPE": "float",
"MIN": 0.0,
"MAX": 2.0,
"DEFAULT": 1.0
},
{
"NAME": "swag2",
"TYPE": "float",
"MIN": 0.0,
"MAX": 4.0,
"DEFAULT": 2.0
},
{
"NAME": "swag3",
"TYPE": "float",
"MIN": 0.1,
"MAX": 2.0,
"DEFAULT": 0.5
},
{
"NAME": "swag4",
"TYPE": "float",
"MIN": 0.0,
"MAX": 8.0,
"DEFAULT": 2.0
},
{
"NAME": "swag5",
"TYPE": "float",
"MIN": 0.0,
"MAX": 2.0,
"DEFAULT": 1.0
},
{
"NAME": "timeswag",
"VALUES": [
1.0,
4.0,
8.0
],
"LABELS": [
"slow",
"medium",
"fast"
],
"DEFAULT": 1.0,
"TYPE": "long"
}
],
}*/
vec3 iResolution = vec3(RENDERSIZE, 1.);
float iTime = TIME;
void mainImage( out vec4 fragColor, in vec2 fragCoord )
{
// Normalized pixel coordinates (from 0 to 1)
vec2 c = (swag1 * fragCoord.xy - iResolution.xy) / iResolution.y;
/**
* uncomment as many or as few of the following lines as you like
*
* Or add your own of the form
* c = some_function_of(c)
*/
c = vec2(c.x * c.x - c.y * c.y, swag2 * c.x * c.y);
// c = 8.0 * mat2(0.96, 0.28, -0.28, 0.96) * c;
c = mat2(cos(iTime/timeswag), sin(iTime/timeswag), -sin(iTime/timeswag), cos(iTime/timeswag)) * c;
// c = c + 0.1 * c * sin(8.0 * (length(c) + iTime));
// c = 4.0 * c;
/**
* end of things to uncomment
*/
c = mod(abs(mod(swag3 * (1.0 + c), vec2(swag4)) - vec2(1.0)), vec2(1.0));
fragColor = texture(iChannel0, 0.5 * (swag5 + c));
}
void main(void) {
mainImage(gl_FragColor, gl_FragCoord.xy);
}