Stripes

Basically just animates stripes moving across whatever u put it on. This is my first ever shader made for learning purposes, so sorry if it sucks lol

Shader code
shader_type canvas_item;
uniform float line_width = 0.2;
uniform float spacing = 0.2;
uniform float time_per_cycle = 8.0;

void fragment() {
	float adjusted_spacing = spacing + line_width;
	
	float diagonal = (UV.x - UV.y) + (TIME/time_per_cycle);
	float spaced_diagonal = mod(diagonal, adjusted_spacing);
	
	if (spaced_diagonal < line_width) {
		COLOR *= vec4(0.75, 0.75, 0.8, 1.0);
	}
}
Live Preview
Tags
animation, lines, pattern, stripes
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.

Related shaders

guest

0 Comments
Oldest
Newest Most Voted