aboutsummaryrefslogtreecommitdiff
path: root/visuals.frag
diff options
context:
space:
mode:
Diffstat (limited to 'visuals.frag')
-rw-r--r--visuals.frag12
1 files changed, 11 insertions, 1 deletions
diff --git a/visuals.frag b/visuals.frag
index 3539bdc..16e7712 100644
--- a/visuals.frag
+++ b/visuals.frag
@@ -2,7 +2,17 @@
#include "config.h"
+uniform float time;
+
+// adapted from <https://www.shadertoy.com/view/4djSRW>
+float hash12(vec2 p) {
+ vec3 p3 = fract(vec3(p.xyx) * .1031);
+ p3 += dot(p3, p3.yzx + 33.33);
+ return fract((p3.x + p3.y) * p3.z);
+}
+
void main() {
- gl_FragColor = vec4(gl_FragCoord.x / WIDTH, gl_FragCoord.y / HEIGHT, 0, 1);
+ vec2 pos = gl_FragCoord.xy + time;
+ gl_FragColor = vec4(vec3(hash12(pos)), 1.0);
}