🎯
Focusing
- Moscow, Russia
Pinned Loading
-
[JS] Smoothstep function
[JS] Smoothstep function 1function smoothstep(edgeA, edgeB, x) {
2// Scale, bias and saturate x to 0..1 range
3x = clamp((x - edgeA) / (edgeB - edgeA), 0, 1);
4// Evaluate polynomial
5return x * x * (3 - 2 * x);
-
[JS] Mix (or lerp) function
[JS] Mix (or lerp) function 1function mix(a, b, amount) {
2return a + amount * (b - a)
3}
-
[JS] Smootherstep function
[JS] Smootherstep function 1function smootherstep(edgeA, edgeB, x) {
2// Scale, bias and saturate x to 0..1 range
3x = clamp((x - edgeA) / (edgeB - edgeA), 0, 1)
4// Evaluate polynomial
5return x * x * x * (x * (x * 6 - 15) + 10)
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.