Created
August 5, 2024 21:14
-
-
Save skeddles/be3d1670552f906d4fb575b6de6d5c63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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