#version 440 QC_INCLUDE "customfrag.glsl" float sdRoundRect(vec2 p, vec2 b, float r) { vec2 q = abs(p) - b + vec2(r); return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - r; } void main() { float keep = 1.0; if (data4.x > 0.5) { vec2 p = fragCoord - data1.xy; float feather = max(data3.y, 0.0001); keep = smoothstep(-feather, feather, sdRoundRect(p, data1.zw, data3.x)); } float a = keep * data2.w * globalAlpha * antialiasingAlpha(); fragColor = vec4(data2.rgb * a, a); }