summaryrefslogtreecommitdiff
path: root/Assets/Shaders/Scanlines.gdshader
diff options
context:
space:
mode:
authorSophia Pearson <codergal89@gmail.com>2022-12-24 11:21:04 +0100
committerSophia Pearson <codergal89@gmail.com>2022-12-24 11:21:04 +0100
commit3f86cb00681200d89b5c09d5c6b6bde53b6c75bd (patch)
tree84523239f61c965e5010977bb64d8bea188cf34f /Assets/Shaders/Scanlines.gdshader
parent8127b227a172a96d11beaf3cf8d9cc67fa830d03 (diff)
downloadtexty-3f86cb00681200d89b5c09d5c6b6bde53b6c75bd.tar.xz
texty-3f86cb00681200d89b5c09d5c6b6bde53b6c75bd.zip
effects: start rework of screen effect
Diffstat (limited to 'Assets/Shaders/Scanlines.gdshader')
-rw-r--r--Assets/Shaders/Scanlines.gdshader16
1 files changed, 16 insertions, 0 deletions
diff --git a/Assets/Shaders/Scanlines.gdshader b/Assets/Shaders/Scanlines.gdshader
new file mode 100644
index 0000000..4ed746c
--- /dev/null
+++ b/Assets/Shaders/Scanlines.gdshader
@@ -0,0 +1,16 @@
+shader_type canvas_item;
+
+uniform float count: hint_range(240, 480, 2) = 320;
+uniform float opacity: hint_range(0.0, 1.0, 0.01) = 0.3;
+
+void fragment() {
+ vec3 color = texture(SCREEN_TEXTURE, SCREEN_UV).rgb;
+ vec2 uv = SCREEN_UV;
+
+ vec2 line = vec2(sin(uv.y * count), cos(uv.y * count));
+ vec3 scanlines = vec3(line.y, line.x, line.y);
+
+ color += color * scanlines * opacity;
+
+ COLOR = vec4(color, 1.0);
+} \ No newline at end of file