summaryrefslogtreecommitdiff
path: root/examples/live/shaders/picture.frag
diff options
context:
space:
mode:
Diffstat (limited to 'examples/live/shaders/picture.frag')
-rw-r--r--examples/live/shaders/picture.frag13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/live/shaders/picture.frag b/examples/live/shaders/picture.frag
new file mode 100644
index 0000000..ec1293e
--- /dev/null
+++ b/examples/live/shaders/picture.frag
@@ -0,0 +1,13 @@
+#version 450
+#extension GL_GOOGLE_include_directive : require
+// The color tape at every pixel; x and y run 0..1, y up.
+#include "Picture.glsl"
+#define TAPE(i) u.tape[i]
+#include "vm.glsl"
+
+layout(location = 0) out vec4 out_color;
+
+void main() {
+ vec2 p = vec2(gl_FragCoord.x, u.size.y - gl_FragCoord.y) / u.size;
+ out_color = vec4(clamp(vm(0u, u.len, u.time, p.x, p.y), 0.0, 1.0), 1.0);
+}