fix: adjust blob border inset delay
This commit is contained in:
parent
665594023e
commit
2b63ffe70c
1 changed files with 7 additions and 2 deletions
|
|
@ -197,8 +197,13 @@ void main() {
|
||||||
// Screen-space center (with offset) and pre-computed AABB half-extents
|
// Screen-space center (with offset) and pre-computed AABB half-extents
|
||||||
vec2 ctr = rect.xy + sinkProps.yz;
|
vec2 ctr = rect.xy + sinkProps.yz;
|
||||||
|
|
||||||
// Delay sink to absorb smin blend depth (circular smin max = (sqrt(2)-1)*k)
|
// Sink onset / residual overlap: how far a rect must penetrate the border before
|
||||||
float preOff = smoothFactor * (sqrt(2.0) - 1.0);
|
// 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
|
// Top border: track rect's BOTTOM edge, only within border thickness
|
||||||
float topPen = clamp(innerTop - (ctr.y + sinkSh.y) - preOff, 0.0, innerTop - outerTop);
|
float topPen = clamp(innerTop - (ctr.y + sinkSh.y) - preOff, 0.0, innerTop - outerTop);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue