This is a proof-of-concept of a rendering using a "smoothed minimum" function.
function smoothMin(a, b, k) { let h = clamp(0.5 + 0.5 * (a - b) / k, 0.0, 1.0); return lerp(a, b, h) - k * h * (1.0 - h); }
The function returns a value close to the minimum while smoothly interpolating between the two input values at the discontinuity. The "k" parameter controls the amount of smoothing. At low values, the function acts like a normal minimum function. This can be used in conjuntion with distance field/raymarch rendering to generate the "blob" effect demonstrated below. The goal is for this to be incorporated (in 3 dimensions) into libraymarcher.
The below example is generated using p5.js, based on the original multithreaded prototype in java. It works by generating a distance field in which every point on the canvas is associated with a distance to to the closest object/circle. The distance should be the minimum of the disances to each object in the scene, calculated using the smooth minimum function. Alpha fading is accomplished by applying a negative exponential to the scene distance field and multiplying it by the smoothed object colors.
Press any key while the canvas is focused to randomize the scene.