From 2b63ffe70c0e14c571c71f157988285da693190e Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Thu, 4 Jun 2026 21:37:11 +1000 Subject: [PATCH] fix: adjust blob border inset delay --- plugin/src/Caelestia/Blobs/shaders/blob.frag | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugin/src/Caelestia/Blobs/shaders/blob.frag b/plugin/src/Caelestia/Blobs/shaders/blob.frag index e0cef71b..138928fa 100644 --- a/plugin/src/Caelestia/Blobs/shaders/blob.frag +++ b/plugin/src/Caelestia/Blobs/shaders/blob.frag @@ -197,8 +197,13 @@ void main() { // Screen-space center (with offset) and pre-computed AABB half-extents vec2 ctr = rect.xy + sinkProps.yz; - // Delay sink to absorb smin blend depth (circular smin max = (sqrt(2)-1)*k) - float preOff = smoothFactor * (sqrt(2.0) - 1.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 + // (squared) corners; too high and the rect nestles too deep before the wall yields. + // Tuned between the old cubic blend depth (k/6, too shallow) and the circular blend + // depth ((sqrt2-1)k): half the circular smin gap-closing distance, (2-sqrt2)k/2. + float preOff = smoothFactor * (2.0 - sqrt(2.0)) * 0.5; // Top border: track rect's BOTTOM edge, only within border thickness float topPen = clamp(innerTop - (ctr.y + sinkSh.y) - preOff, 0.0, innerTop - outerTop);