Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save skeddles/be3d1670552f906d4fb575b6de6d5c63 to your computer and use it in GitHub Desktop.
Save skeddles/be3d1670552f906d4fb575b6de6d5c63 to your computer and use it in GitHub Desktop.
shader_type canvas_item;
render_mode unshaded;
uniform float circle_size : hint_range(0.0, 1.05);
uniform float screen_width;
uniform float screen_height;
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
void fragment() {
float ratio = screen_width / screen_height;
float dist = distance(vec2(0.5, 0.5), vec2(mix(0.5, UV.x, ratio), UV.y));
COLOR.a = step(dist,circle_size);
//canvasgroupshader
vec4 c = textureLod(screen_texture, SCREEN_UV, 0.0);
if (c.a > 0.0001) {
c.rgb /= c.a;
}
COLOR *= c;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment