softPlus
A soft hinge: about 0 for values well below zero, about x above, rounded near zero.
softPlus(x: Expr, k: Val): Expr
Import math from shaders/std and use math.softPlus.
k is the width of the rounded corner. Use it where a hard max(x, 0) would show a visible crease.
Parameters
| Name | Type | Notes |
|---|---|---|
x | Expr | |
k | Val |
Example
const past = local(softPlus(sub(beam.along, beam.length), mul(softness, 0.6)), 'past')
See also
max— The larger of two values.smoothstep— A soft edge: 0 belowe0, 1 abovee1, an S-curve between.