Choosing the blend radius

Built on the polynomial smooth minimum by Inigo Quilez. Sources for this reference

smin is what makes a pile of primitives read as one object. The blend radius k is the single number that decides whether it looks like a creature or like a bag of balls, and it is almost always picked by feel.

float smin(float a, float b, float k){
    float h = clamp(0.5 + 0.5*(b - a)/k, 0.0, 1.0);
    return mix(b, a, h) - k*h*(1.0 - h);
}
The same two circles at k = 0, 0.22, 0.45, 0.90. Cyan marks where the blend moved the surface away from a hard union.

The first panel is a hard min: two circles with a visible crease where they meet, and the distance bands kink at the seam. By the last panel the joint has swallowed the shapes themselves, which is the failure people notice late, because it looks smooth and expensive right up until the forms stop reading.

What k actually costs you

Three things move together as k grows, and only the first is the one anybody is aiming at:

  1. The fillet radius at the joint, which is the point.
  2. The field stops being a true distance. smin undershoots, so a sphere trace takes smaller steps than it needs to. Safe, but slower.
  3. The surface moves everywhere near the joint, not only in the gap. Cyan in the demo is that region, and it grows faster than people expect.

A constant k is wrong the moment anything tapers

This is the part that matters for characters. A limb is a chain of circles whose radius falls from shoulder to wrist. Blend every joint with the same k and the thin end drowns: at the wrist, k is a large fraction of the local radius, so the joint bulges and the taper disappears.

A tapering limb. Left: one constant k at every joint. Right: k scaled to the local radius.

On the left the thin end swells into a sausage and the silhouette stops tapering. On the right the same chain keeps its shape all the way down, because k is proportional to the radius it is joining. Scale-relative is the fix, and it is one multiply.

Rules of thumb

  1. Make k a fraction of the smaller radius at the joint, not a constant. Around 0.4 to 0.6 of it is a good starting band.
  2. If the fillet is eating the forms, you are past the point where more smoothing helps.
  3. smin undershoots the true distance, so it is safe for sphere tracing but costs steps.
  4. Chained smin is order-dependent. Blending A with B then C is not the same shape as A with C then B.
  5. Look at the distance bands, not just the silhouette. A crease in the bands is a crease in the field.

All 61 notes How to use them Credits