You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
511 B
Plaintext
24 lines
511 B
Plaintext
|
2 years ago
|
shader_type canvas_item;
|
||
|
|
|
||
|
|
uniform vec4 in_color:source_color;
|
||
|
|
uniform float position:hint_range(-2,1.) = 0.856;
|
||
|
|
uniform vec2 size = vec2(32., 32.);
|
||
|
|
|
||
|
|
void fragment(){
|
||
|
|
vec2 a = (1./SCREEN_PIXEL_SIZE) / size;
|
||
|
|
|
||
|
|
vec2 uv=UV;
|
||
|
|
uv *= a;
|
||
|
|
|
||
|
|
vec2 i_uv = floor(uv);
|
||
|
|
vec2 f_uv = fract(uv);
|
||
|
|
|
||
|
|
float wave = max(0.,i_uv.x/(a.x) - position);
|
||
|
|
|
||
|
|
vec2 center = f_uv*2.-1.;
|
||
|
|
float circle = abs(center.x)+abs(center.y);
|
||
|
|
circle = 1. - step(wave,circle);
|
||
|
|
|
||
|
|
COLOR=vec4(circle) * in_color;
|
||
|
|
}
|