aboutsummaryrefslogtreecommitdiff
path: root/res/shaders/glsl330/line.fs
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-02-11 04:50:35 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-02-11 04:50:35 +0000
commit2bb276d4ed15277cb0172353250fd7e92bf12840 (patch)
tree8e8aef0d879ff71e5ec312b8e6cc01b3740f37dd /res/shaders/glsl330/line.fs
parentadd sources (diff)
downloadshadertoy-2bb276d4ed15277cb0172353250fd7e92bf12840.tar.gz
add resources
Diffstat (limited to 'res/shaders/glsl330/line.fs')
-rw-r--r--res/shaders/glsl330/line.fs27
1 files changed, 27 insertions, 0 deletions
diff --git a/res/shaders/glsl330/line.fs b/res/shaders/glsl330/line.fs
new file mode 100644
index 0000000..d7a8d48
--- /dev/null
+++ b/res/shaders/glsl330/line.fs
@@ -0,0 +1,27 @@
1#version 330 core
2
3uniform float time;
4uniform vec2 resolution;
5uniform vec2 mouse;
6
7out vec4 color;
8
9float
10plot (vec2 st)
11{
12 return smoothstep (0.01, 0.0, abs (st.y - st.x));
13}
14
15void
16main () {
17 vec2 st = gl_FragCoord.xy/resolution;
18
19 float y = st.x;
20
21 vec3 c = vec3 (y);
22
23 float pct = plot (st);
24 c = (1.0 - pct)*c + pct*vec3 (0.0, 1.0, 0.0);
25
26 color = vec4 (c, 1.0);
27}