diff options
| author | jules <jules@okfoc.us> | 2014-01-15 05:29:07 -0500 |
|---|---|---|
| committer | jules <jules@okfoc.us> | 2014-01-15 05:29:07 -0500 |
| commit | e09b67f7dd89e17aeaca463f012b5f8655d09a7b (patch) | |
| tree | 6e6397ec84d9f319148098b927dd82e8d6b4f188 /js | |
| parent | 0a57883969405be46126746777f81b1bf2d270e0 (diff) | |
| parent | 282657a4beb7c78c4420c6b8268d8d929fe6a670 (diff) | |
Merge branch 'master' of lmno:dither
Diffstat (limited to 'js')
| -rw-r--r-- | js/util.js | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -61,9 +61,13 @@ function step(a, b){ // ^^ bool -> int } +function julestep (a,b,n) { + return clamp((n - a) / (b - a), 0.0, 1.0); +} + // hermite curve apparently -function smoothstep(n,a,b){ - var t = clamp((n - a) / (b - a), 0.0, 1.0); +function smoothstep(min,max,n){ + var t = clamp((n - min) / (max - min), 0.0, 1.0); return t * t * (3.0 - 2.0 * t) } |
