Skip to content

Commit 96b9f49

Browse files
JUNAID NAWAZJUNAID NAWAZ
authored andcommitted
docs(p5.strands): refine smoothstep description and examples
1 parent dbd942b commit 96b9f49

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/strands/p5.strands.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ if (typeof p5 !== "undefined") {
291291
* callbacks. It is commonly used to create soft transitions, smooth edges,
292292
* fades, and anti-aliased effects.
293293
*
294+
* Smoothstep is useful when a threshold or cutoff is needed, but with a
295+
* gradual transition instead of a hard edge.
296+
*
294297
* - Returns `0.0` when `x` is less than or equal to `edge0`
295298
* - Returns `1.0` when `x` is greater than or equal to `edge1`
296299
* - Smoothly interpolates between `0.0` and `1.0` when `x` is between them
@@ -318,7 +321,7 @@ if (typeof p5 !== "undefined") {
318321
* let x = inputs.texCoord.x;
319322
*
320323
* // smoothstep creates a soft transition instead of a hard edge
321-
* let t = smoothstep(0.45, 0.55, x);
324+
* let t = smoothstep(0.25, 0.35, x);
322325
*
323326
* // Use t directly as brightness
324327
* return [t, t, t, 1];

0 commit comments

Comments
 (0)