shader_type canvas_item; uniform float percent; float atan2(in float y, in float x) { bool s = (abs(x) > abs(y)); if (s) { return 3.14159/2.0 - atan(x,y); } else { return atan(y,x); } } void fragment() { float angle = atan2((UV.y - 0.5) , (UV.x - 0.5)); float alpha = step(percent * 3.14159 * 2.25, angle + 3.14159); vec4 color = texture(TEXTURE, UV); COLOR = vec4(color.rgb, color.a * alpha); }