Disappearance shader 2D

This is my first attemption to clone shader from Crossout, but i think, i made it much cooler.
Without anti-aliasing.

Shader code
shader_type canvas_item;

uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
uniform float size: hint_range(-1.,1.) = 0.;
uniform vec2 source_size = vec2(16., 16.);

void fragment() {
	vec2 point = (1./TEXTURE_PIXEL_SIZE) / source_size;
	vec2 uv_temp = UV;
	uv_temp *= point;
	vec2 i_uv = floor(uv_temp);
	vec2 f_uv = fract(uv_temp); 
	float wave = max(0.,i_uv.x/i_uv.x*2.-1. - sin(TIME));//replace sin(TIME) with "size" to custom param
	vec2 center = (f_uv*2.-1.);
	float shape = length(tan(center)*sin(center)-cos(center));
	shape = 1. - step(wave,shape);
	
	COLOR *= shape
}
Tags
2d, canvas, fade, 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.

Related shaders

2D Item Highlight Shader

Blood Shader

Foliage Wind Shader

Subscribe
Notify of
guest

5 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Ipga13
Ipga13
1 year ago

twin towers go bye bye

ancientsion
ancientsion
1 year ago

How can i use this one with godot 3.5 ?
It throws error

uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;

ivor
1 year ago

You have an error on Line 10

uv_temp *= a;

Unknown identifier in expression: ‘a’.

drisicus
1 year ago
Reply to  ivor

We can change that “a” for a vec2(10.0, 10.0) for example, and play with the values.

The higher the values the smaller the dots.

Hope it helps!