diff options
| author | pepper <peppersclothescult@gmail.com> | 2014-01-19 18:16:53 -0800 |
|---|---|---|
| committer | pepper <peppersclothescult@gmail.com> | 2014-01-19 18:16:53 -0800 |
| commit | 5301a264c8da39a9401ab9d619477e0ea2c83dc1 (patch) | |
| tree | 4d458e4f20f72213549f12e000022cbd93e3f237 | |
| parent | f01087dbacca5640205cd2d8c6629b244a15ed74 (diff) | |
| parent | 1e739b4df7e03cc94997e5b5b5c8180b0962e5ee (diff) | |
mergin'
Merge branch 'master' of ghghgh.us:/home/git/dither into pepper
| -rw-r--r-- | instructions.html | 2 | ||||
| -rw-r--r-- | js/util.js | 8 | ||||
| -rw-r--r-- | shader-picker.html | 4 |
3 files changed, 9 insertions, 5 deletions
diff --git a/instructions.html b/instructions.html index fb522c0..dff99d8 100644 --- a/instructions.html +++ b/instructions.html @@ -30,7 +30,7 @@ E, PI, PHI clamp(n,min,max) mix(n,a,b) (lerp) step(a,b) -smoothstep(n,a,b) +smoothstep(min,max,n) avg(m,n,a) cosp, sinp (mapped to [0,1]) pixel(x,y) == 4*(y*w+h) @@ -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) } diff --git a/shader-picker.html b/shader-picker.html index 27f537d..59b3e27 100644 --- a/shader-picker.html +++ b/shader-picker.html @@ -145,8 +145,8 @@ function init(){ stop: drag_stop }); $(document).on("mousemove", function(e) { - mousex = event.pageX - mousey = event.pageY + mousex = e.pageX + mousey = e.pageY }) $(document).on("click","#frames .remove",remove_frame) $("#framecount").change(function(){ |
