Simple Worldborder

A simple Minecraft style animated worldborder.

I am no shader expert, so please comment if there is something to improve.

Shader code
shader_type spatial;
render_mode shadows_disabled;

uniform float scale = 5.0;
uniform vec4 color : source_color = vec4(0.225, 0.97, 0.9, 0.25);

void fragment() {

	vec2 uv = UV * scale;
	float ar = (VIEWPORT_SIZE.x/VIEWPORT_SIZE.y);
	float t = (fract(TIME/7.5) * scale);
	float x = uv.x + (uv.y * ar) - t;

	ALPHA = 0.0;

	for(float i = -4.0; i < 4.0; i += 0.25) {

		float off = (i * scale) + x;

		if(off > 0.0 && off < 0.5) {
			ALBEDO = vec3(color.rgb) * mix(0.25, 1.0, off);
			ALPHA = color.a;
		}
	}
}
Tags
minecraft, worldborder
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

Simple, cheap stylized tree shader

Simple fullscreen raymarching

Simple World Triplanar Grid (Allows Transparency)

Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments