naelstrof 9 anni fa
parent
commit
9934c030f5

+ 38
- 0
share/slop/cross.frag Vedi File

@@ -0,0 +1,38 @@
1
+#version 120
2
+
3
+uniform sampler2D texture;
4
+uniform sampler2D desktop;
5
+uniform int desktopWidth;
6
+uniform int desktopHeight;
7
+uniform float time;
8
+
9
+varying vec2 uvCoord;
10
+
11
+void main() {
12
+    float stitching_size = 6.0;
13
+    int invert = 0;
14
+
15
+    float size = stitching_size;
16
+    vec2 cPos = uvCoord * vec2(desktopWidth, desktopHeight);
17
+    vec2 tlPos = floor(cPos / vec2(size, size));
18
+    tlPos *= size;
19
+    int remX = int(mod(cPos.x, size));
20
+    int remY = int(mod(cPos.y, size));
21
+    if (remX == 0 && remY == 0)
22
+    tlPos = cPos;
23
+    vec2 blPos = tlPos;
24
+    blPos.y += (size - 1.0);
25
+    if ((remX == remY) || (((int(cPos.x) - int(blPos.x)) == (int(blPos.y) - int(cPos.y))))) {
26
+        if (invert == 1) {
27
+            gl_FragColor = vec4(0.2, 0.15, 0.05, 1.0);
28
+        } else {
29
+            gl_FragColor = texture2D(texture, tlPos * vec2(1.0/desktopWidth, 1.0/desktopHeight)) * 1.4;
30
+        }
31
+    } else {
32
+        if (invert == 1) {
33
+            gl_FragColor = texture2D(texture, tlPos * vec2(1.0/desktopWidth, 1.0/desktopHeight)) * 1.4;
34
+        } else {
35
+            gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
36
+        }
37
+    }
38
+}

+ 12
- 0
share/slop/cross.vert Vedi File

@@ -0,0 +1,12 @@
1
+#version 120
2
+
3
+attribute vec2 vertex;
4
+attribute vec2 uv;
5
+
6
+varying vec2 uvCoord;
7
+
8
+void main()
9
+{
10
+    uvCoord = uv;
11
+	gl_Position = vec4(vertex,0,1);
12
+}

+ 30
- 0
share/slop/hippie.frag Vedi File

@@ -0,0 +1,30 @@
1
+#version 120
2
+
3
+uniform sampler2D texture;
4
+uniform sampler2D desktop;
5
+uniform int desktopWidth;
6
+uniform int desktopHeight;
7
+uniform float time;
8
+
9
+varying vec2 uvCoord;
10
+
11
+const float pi = 3.14159265f;
12
+
13
+vec3 color(float x) {
14
+    return max(min(sin(vec3(x,x+pi*2.0/3.0,x+pi*4.0/3.0))+0.5,1.0),0.0);
15
+}
16
+
17
+void main() {
18
+    vec2 resolution = vec2( desktopWidth, desktopHeight );
19
+    vec2 pos = (( gl_FragCoord.xy / resolution.xy )-0.5)*resolution.xy/resolution.x*4.0;
20
+    pos+=normalize(pos);
21
+    pos.xy+=sin(pos.yx*10.0)*0.1;
22
+    float r=(2.0/(dot(pos,pos)*10.0+1.0));
23
+    vec2 rr=vec2(cos(r),sin(r));
24
+    pos=pos.xy*rr.xx+pos.yx*rr.yy*vec2(-1.0,1.0);
25
+    float f=(length(pos)*10.0)+time;
26
+    //f=acos((pos.x/length(pos)*0.5+0.5)*pi);
27
+    f+=sin(atan(pos.y,pos.x)*7.0)*5.0;
28
+    float alpha = texture2D(texture,uvCoord).a;
29
+    gl_FragColor = vec4(color(f),alpha);
30
+}

+ 12
- 0
share/slop/hippie.vert Vedi File

@@ -0,0 +1,12 @@
1
+#version 120
2
+
3
+attribute vec2 vertex;
4
+attribute vec2 uv;
5
+
6
+varying vec2 uvCoord;
7
+
8
+void main()
9
+{
10
+    uvCoord = uv;
11
+	gl_Position = vec4(vertex,0,1);
12
+}

+ 16
- 0
share/slop/invert.frag Vedi File

@@ -0,0 +1,16 @@
1
+#version 120
2
+
3
+uniform sampler2D texture;
4
+uniform sampler2D desktop;
5
+uniform int desktopWidth;
6
+uniform int desktopHeight;
7
+uniform float time;
8
+
9
+varying vec2 uvCoord;
10
+
11
+void main() {
12
+    vec2 uv = vec2( uvCoord.x, -uvCoord.y );
13
+    vec4 color = texture2D(desktop,uv);
14
+    float alpha = texture2D(texture,uvCoord).a;
15
+    gl_FragColor = vec4( 1.0 - color.r, 1.0 - color.g, 1.0 - color.b, alpha );
16
+}

+ 13
- 0
share/slop/invert.vert Vedi File

@@ -0,0 +1,13 @@
1
+#version 120
2
+
3
+attribute vec2 vertex;
4
+attribute vec2 uv;
5
+
6
+varying vec2 uvCoord;
7
+
8
+void main()
9
+{
10
+    uvCoord = uv;
11
+    gl_Position = vec4(vertex,0,1);
12
+}
13
+

+ 4
- 12
share/slop/refract.frag Vedi File

@@ -21,18 +21,10 @@ void main() {
21 21
     float numBlurPixelsPerSide = 2.0f;
22 22
     float blurMultiplier = 2.0f;
23 23
 
24
-    // Don't change anything below.
25
-    float blurSize = 1.f/desktopHeight*blurMultiplier;
26
-    vec2  blurMultiplyVec      = vec2(0.0f, 1.0f);
27
-    // Higher strength means bigger wobble
28
-    float strength = 8;
29
-    // Higher speed means faster wobble
30
-    float speed = 1;
31
-    float x = (sin( time*speed + uvCoord.y * desktopHeight/strength ) + 0.5)/desktopWidth*strength;
32
-    float y = (cos( time*speed + uvCoord.x * desktopWidth/strength ) + 0.5)/desktopHeight*strength;
33
-    x = x - (sin( time*speed*0.5 + uvCoord.y * desktopHeight/strength ) + 0.5)/desktopWidth*strength/2;
34
-    y = y - (cos( time*speed*0.5 + uvCoord.x * desktopWidth/strength ) + 0.5)/desktopHeight*strength/2;
35
-    vec2 offset = vec2(x,y);
24
+    vec2 tc = uvCoord.xy;
25
+    vec2 p = -1.0 + 2.0 * tc;
26
+    float len = length(p);
27
+    vec2 offset = (p/len)*cos(len*12.0-time*4.0)*0.005;
36 28
 
37 29
     // Incremental Gaussian Coefficent Calculation (See GPU Gems 3 pp. 877 - 889)
38 30
     vec3 incrementalGaussian;

+ 17
- 0
share/slop/ripple.frag Vedi File

@@ -0,0 +1,17 @@
1
+#version 120
2
+
3
+uniform sampler2D texture;
4
+uniform sampler2D desktop;
5
+uniform int desktopWidth;
6
+uniform int desktopHeight;
7
+uniform float time;
8
+
9
+varying vec2 uvCoord;
10
+
11
+void main() {
12
+    vec2 tc = uvCoord.xy;
13
+    vec2 p = -1.0 + 2.0 * tc;
14
+    float len = length(p);
15
+    vec2 uv = tc + (p/len)*cos(len*12.0-time*4.0)*0.02;
16
+    gl_FragColor = texture2D(texture,uv);
17
+}

+ 13
- 0
share/slop/ripple.vert Vedi File

@@ -0,0 +1,13 @@
1
+#version 120
2
+
3
+attribute vec2 vertex;
4
+attribute vec2 uv;
5
+
6
+varying vec2 uvCoord;
7
+
8
+void main()
9
+{
10
+    uvCoord = uv;
11
+    gl_Position = vec4(vertex,0,1);
12
+}
13
+