From 3f86cb00681200d89b5c09d5c6b6bde53b6c75bd Mon Sep 17 00:00:00 2001 From: Sophia Pearson Date: Sat, 24 Dec 2022 11:21:04 +0100 Subject: effects: start rework of screen effect --- Assets/Shaders/Scanlines.gdshader | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Assets/Shaders/Scanlines.gdshader (limited to 'Assets/Shaders/Scanlines.gdshader') 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 -- cgit v1.2.3