home/ atoms/ smoothstep-threshold-control

Smoothstep with adjustable limits controls where a procedural pattern transitions from dark to light

smoothstep(edge0, edge1, x) maps x to [0,1] with smooth cubic transitions at both ends. By narrowing or widening the gap between edge0 and edge1 you control the sharpness of the transition: close edges = sharp threshold (nearly binary); far edges = soft gradient. In shader art this is used constantly — to sharpen a sine-wave grass pattern into two-color spots, to control fog density, to make cloud edges crisp. The function can also be used backward (smoothstep(1,0,x)) to invert the transition direction.

Examples

float grass = smoothstep(0.4, 0.6, sin(p.x) + sin(p.z)); // sharp two-color pattern

Assessment

Change edge0 from 0.4 to 0.49 and edge1 from 0.6 to 0.51 in the grass example. Describe the visual change and what physical material this extreme sharpness might represent.

“smooth step is basically a cubic function. We will go through that in another tutorial but helps me take the basic product gradient that I have”
corpus · inigo-quilez-live-coding-happy-jumping-video · chunk 2