feat: better notification storage and image caching + blobs
C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 11s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 12s
JS/TS / lint (pull_request) Successful in 10s
Python / static (pull_request) Failing after 27s
Rust / build (pull_request) Successful in 54s
Python / verify (pull_request) Failing after 1m26s
Rust / fmt (pull_request) Successful in 46s
Rust / clippy (pull_request) Successful in 1m6s
C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 11s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 12s
JS/TS / lint (pull_request) Successful in 10s
Python / static (pull_request) Failing after 27s
Rust / build (pull_request) Successful in 54s
Python / verify (pull_request) Failing after 1m26s
Rust / fmt (pull_request) Successful in 46s
Rust / clippy (pull_request) Successful in 1m6s
This commit is contained in:
@@ -43,19 +43,26 @@ float sdBox(vec2 p, vec2 center, vec2 halfSize) {
|
||||
}
|
||||
|
||||
float smin(float a, float b, float k) {
|
||||
float h = max(k - abs(a - b), 0.0) / k;
|
||||
return min(a, b) - h * h * h * k * (1.0 / 6.0);
|
||||
// Circular smooth min — the blend fillet is a true circular arc of radius k,
|
||||
// tangent to both surfaces (not a polynomial/squircle curve). Deviates from
|
||||
// min(a, b) only in the corner region where BOTH a < k and b < k (unlike the
|
||||
// cubic, which deviates over the whole band |a - b| < k and dents the surface
|
||||
// inward while the shapes are still apart). Always <= min(a, b); max blend
|
||||
// depth at a == b is (sqrt(2) - 1) * k.
|
||||
return max(k, min(a, b)) - length(max(vec2(k) - vec2(a, b), vec2(0.0)));
|
||||
}
|
||||
|
||||
float smax(float a, float b, float k) {
|
||||
float h = max(k - abs(a - b), 0.0) / k;
|
||||
return max(a, b) + h * h * h * k * (1.0 / 6.0);
|
||||
// Circular smooth max — dual of smin: -smin(-a, -b, k). Always >= max(a, b).
|
||||
return min(-k, max(a, b)) + length(max(vec2(a, b) + vec2(k), vec2(0.0)));
|
||||
}
|
||||
|
||||
float smaxSharpA(float a, float b, float k) {
|
||||
float h = max(k - abs(a - b), 0.0) / k;
|
||||
float blend = h * h * h * k * (1.0 / 6.0);
|
||||
blend *= smoothstep(0.0, k * 0.5, -a);
|
||||
// Circular smax variant that keeps a's boundary sharp (no inward rounding at
|
||||
// a = 0). Used for the frame outer edge so it always fills to the edges.
|
||||
float sm =
|
||||
min(-k, max(a, b)) + length(max(vec2(a, b) + vec2(k), vec2(0.0)));
|
||||
float blend = (sm - max(a, b)) * smoothstep(0.0, k * 0.5, -a);
|
||||
return max(a, b) + blend;
|
||||
}
|
||||
|
||||
@@ -148,7 +155,8 @@ void main() {
|
||||
continue;
|
||||
if ((excludeMask & (1 << j)) != 0)
|
||||
continue;
|
||||
if (abs(dArr[i] - dArr[j]) >= smoothFactor)
|
||||
// Circular smin deviates from min only where BOTH d values are < k.
|
||||
if (max(dArr[i], dArr[j]) >= smoothFactor)
|
||||
continue;
|
||||
mergedSdf = min(mergedSdf, smin(dArr[i], dArr[j], smoothFactor));
|
||||
}
|
||||
@@ -179,7 +187,13 @@ void main() {
|
||||
smoothstep(innerRight - smoothFactor, innerRight, pixel.x);
|
||||
|
||||
float sinkValue = 0.0;
|
||||
float preOff = smoothFactor * (1.0 / 6.0);
|
||||
// Sink onset / residual overlap: how far a rect must penetrate the border
|
||||
// before the inner wall recedes to form its pocket. Too low and the wall
|
||||
// recedes faster than the junction can stay convex, denting the inner edge
|
||||
// inward near the rect's corners; too high and the rect nestles too deep
|
||||
// before the wall yields. Tuned to the circular smin blend depth: half the
|
||||
// gap-closing distance, (2 - sqrt(2)) * k / 2.
|
||||
float preOff = smoothFactor * (2.0 - sqrt(2.0)) * 0.5;
|
||||
float s = smoothFactor * 2.0;
|
||||
|
||||
if (topZone > 0.0 || botZone > 0.0 || leftZone > 0.0 || rightZone > 0.0) {
|
||||
@@ -215,9 +229,16 @@ void main() {
|
||||
|
||||
dInner -= sinkValue;
|
||||
|
||||
float negInner = -dInner;
|
||||
float dFrame = dOuter >= negInner ? dOuter
|
||||
: smaxSharpA(dOuter, negInner, smoothFactor);
|
||||
// The circular smax fillet has radius kFrame; when it exceeds the border
|
||||
// thickness it can't complete inside the border, so the sharp outer-box term
|
||||
// bleeds onto the inner edge and bulges the inner corners (worst when
|
||||
// thickness < smoothFactor). Clamp kFrame to the thinnest side so the inner
|
||||
// edge stays a clean constant-radius arc. Each inner corner is bounded by
|
||||
// its thinner adjacent side, so the global min is correct for every corner.
|
||||
float minThick = min(min(innerTop - outerTop, outerBot - innerBot),
|
||||
min(innerLeft - outerLeft, outerRight - innerRight));
|
||||
float kFrame = clamp(min(smoothFactor, minThick - 1.0), 1.0, smoothFactor);
|
||||
float dFrame = smaxSharpA(dOuter, -dInner, kFrame);
|
||||
|
||||
mergedSdf = smin(mergedSdf, dFrame, smoothFactor);
|
||||
if (dFrame < minDist) {
|
||||
|
||||
Reference in New Issue
Block a user