12 From picture to recipe
smin: shapes that melt together
min just puts two shapes together; smin fills the seam with a smooth curve, like two drops of water touching.
0.10.7
0.010.3
ExerciseTune values
Join two separate circles with a wide bridge
Runs once per pixelDrag numbers, or edit the code
JS side
gl.uniform2f(uResolution, …, …)smin(a, b, k) blends a and b wherever they are within k of each other and grows the shape slightly into the seam. A larger k melts over a wider range. Liquids, metaballs and organic shapes all use it.
Try it
- Switch the join back to min and compare the seam
- Pull the circles apart, then raise k: they connect across the gap
- Watch the background rings: smin smooths the distance field itself