Files
Edit2D/shaders/circle.fs
T
SamratGhale d23c934662 Init
2026-03-10 22:11:28 +05:45

19 lines
297 B
GLSL

#version 330
in vec2 f_position;
in vec4 f_color;
in float f_thickness;
out vec4 fragColor;
void main(){
float radius = 1.0;
//distance to circle
vec2 w = f_position;
float dw = length(w);
float d = abs(dw - radius);
fragColor = vec4(f_color.rgb, smoothstep(f_thickness, 0.0, d));
}