summaryrefslogtreecommitdiff
path: root/examples/spheres/shaders/link.frag
diff options
context:
space:
mode:
Diffstat (limited to 'examples/spheres/shaders/link.frag')
-rw-r--r--examples/spheres/shaders/link.frag12
1 files changed, 12 insertions, 0 deletions
diff --git a/examples/spheres/shaders/link.frag b/examples/spheres/shaders/link.frag
new file mode 100644
index 0000000..53da3cf
--- /dev/null
+++ b/examples/spheres/shaders/link.frag
@@ -0,0 +1,12 @@
+#version 450
+// Pulses running from the modulator to the carrier, soft at the edges.
+layout(location = 0) in vec4 color;
+layout(location = 1) in vec2 along;
+layout(location = 2) flat in float time;
+layout(location = 0) out vec4 out_color;
+
+void main() {
+ float pulse = 0.5 + 0.5 * sin(along.x * 0.25 - time * 9.0);
+ float edge = 1.0 - along.y * along.y;
+ out_color = color * edge * (0.3 + 0.7 * pulse * pulse);
+}