Parameters
Name | Type | Description |
---|---|---|
distanceA | f32 | First signed distance field. |
distanceB | f32 | Second signed distance field. |
smoothing | f32 | Smoothing factor for the blend. |
Returns
f32intersected signed distance field.
WGSL Code
fn sdfSmoothIntersect(distanceA: f32, distanceB: f32, smoothing: f32) -> f32 {let h = clamp(0.5 - 0.5 * (distanceB - distanceA) / smoothing, 0.0, 1.0);return mix(distanceB, distanceA, h) + smoothing * h * (1.0 - h);}