Godot Version
Godot 4
Question
I’m working on a shader that simulates the “Iris Shot,” but when I use a tween to transition the values, the generated circle doesn’t look right; it appears to have too few vertices. I’m not sure if that’s really the issue, but the circle doesn’t look smooth. I want it to look fluid. Does anyone know how to fix this or if there’s a better method?`
shader_type canvas_item;
uniform float radius : hint_range(0.0, 1.5) = 1.5;
uniform vec2 center = vec2(0.5, 0.5);
uniform float aspect;
void fragment() {
vec2 uv = SCREEN_UV - center;
uv.x *= aspect;
float dist = length(uv);
float edge = fwidth(dist);
float mask = smoothstep(radius, radius + edge, dist);
COLOR = vec4(0.0, 0.0, 0.0, mask);
}