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 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:
- The fillet radius at the joint, which is the point.
- The field stops being a true distance.
sminundershoots, so a sphere trace takes smaller steps than it needs to. Safe, but slower. - 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.
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
- Make
ka fraction of the smaller radius at the joint, not a constant. Around 0.4 to 0.6 of it is a good starting band. - If the fillet is eating the forms, you are past the point where more smoothing helps.
sminundershoots the true distance, so it is safe for sphere tracing but costs steps.- Chained
sminis order-dependent. Blending A with B then C is not the same shape as A with C then B. - Look at the distance bands, not just the silhouette. A crease in the bands is a crease in the field.
One email when something new goes up. No newsletter, no schedule, nothing else.
Double opt-in, so watch for a confirmation email. Unsubscribe any time.