Initial commit

This commit is contained in:
2026-06-19 18:14:40 +06:00
commit ef3ec8d9f1
671 changed files with 5595 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
float rdist(vec2 pos, vec2 size, vec4 radius) {
radius.xy = (pos.x > 0.0) ? radius.xy : radius.wz;
radius.x = (pos.y > 0.0) ? radius.x : radius.y;
vec2 v = abs(pos) - size + radius.x;
return min(max(v.x, v.y), 0.0) + length(max(v, 0.0)) - radius.x;
}
float ralpha(vec2 size, vec2 coord, vec4 radius, float smoothness) {
vec2 center = size * 0.5;
float dist = rdist(center - (coord * size), center - 1.0, radius);
return 1.0 - smoothstep(1.0 - smoothness, 1.0, dist);
}
const vec2[4] RECT_VERTICES_COORDS = vec2[] (
vec2(0.0, 0.0),
vec2(0.0, 1.0),
vec2(1.0, 1.0),
vec2(1.0, 0.0)
);
vec2 rvertexcoord(int id) {
return RECT_VERTICES_COORDS[id % 4];
}