Lines Screen Transition

Here is a simple lines screen transition. Change y_threshold to change how far along the lines are.

Shader code
shader_type canvas_item;

uniform float num_lines = 20.;
uniform float y_threshold: hint_range(0.0, 1.0) = 0.5;
uniform vec4 line_color_a: hint_color = vec4(1.);
uniform vec4 line_color_b: hint_color = vec4(0., 0., 0., 1.0);

void fragment() {
	vec2 tiled_uv = vec2(fract(UV.x * num_lines / 2.), UV.y);
	if (tiled_uv.x < 0.5){
		if(tiled_uv.y < y_threshold){
			COLOR = line_color_a;
		} else {
			COLOR = vec4(0.0);
		}
	} else {
		if (tiled_uv.y > 1. - y_threshold){
			COLOR = line_color_b;
		} else {
			COLOR = vec4(0.0);
		}
	}
}
Tags
lines, transition
The shader code and all code snippets in this post are under CC0 license and can be used freely without the author's permission. Images and videos, and assets depicted in those, do not fall under this license. For more info, see our License terms.

More from Exuin

Square Pixelation

Radial Speedlines

SPEEDLINES

Related shaders

Diamond-based Screen Transition

Simple 2d transition

Pixel transition

guest
0 Comments
Inline Feedbacks
View all comments