diff options
| -rw-r--r-- | shader-booth.html | 2 | ||||
| -rw-r--r-- | shaders-cam.json | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/shader-booth.html b/shader-booth.html index b16f37d..96741c8 100644 --- a/shader-booth.html +++ b/shader-booth.html @@ -175,7 +175,7 @@ a { color: #00f; } <script type="text/javascript" src="js/save.js"></script> <script type="text/javascript" src="js/util.js"></script> <script type="text/javascript" src="js/help.js"></script> -<script type="text/javascript" src="shaders.json"></script> +<script type="text/javascript" src="shaders-cam.json"></script> <script type="text/html" id="frame-template"> <button class="remove">x</button> diff --git a/shaders-cam.json b/shaders-cam.json new file mode 100644 index 0000000..16c96ae --- /dev/null +++ b/shaders-cam.json @@ -0,0 +1,2 @@ +window.EXAMPLE_SHADERS = [{"name":"red","shader":"r = 255"},{"name":"demo","shader":"\n\nu = x + t/10\nv = y * sin(b/100)\n\nrgbpixel(d,u,v)\n\n"},{"name":"dither","shader":"\nxx = x, yy = y\n\nvar d = ((x % 2) + 2 * (y % 2)) - 2\n\nx += w/2\ny -= h/2\nt/=-200\ny/=96\nx/=50\nv = (sin(t+x*y) + 1.0) / 2\nv = (0.6) * v - 0.4 + random()\n\nv = clamp( v*64 + 128 , 0, 255)\nv += d*32\nif (a == 0) r = g = b = xx/w * 255\na = v > 128 ? v:0\n\n"},{"name":"rotozoom","shader":"u = (x * sin(t/10000)) - (y / cos(t/1000))\nv = (x / cos(t/1000)) + (y * sin(t/10000))\nrgbpixel(d,u,v)"},{"name":"donjuan","shader":"t /= 500\nif (a == 0) { r = g = b = 0; t /= -3 }\nr *= (sin(t*x/y) + 1)/2\ng *= (cos(t*y/x) + 0.4)/2\nb *= (sin(t) + 1.5)/2\na = b/9"},{"name":"barber","shader":"t/=10\noo = (y+x+t) % 100\nr *= 1/sin(oo/100)\ng *= 1/sin(oo/100)\nb *= 1/sin(oo/100)"},{"name":"redsmear","shader":"r = x\nz = 10\nr += random()*z\ng += random()*z\nb += random()*z"},{"name":"colorcycle","shader":"\nt /= 5000\nr = hsl2rgb( b/255 + t%2-1, 1.0, 0.5)[0]\n"},{"name":"tvfuzz","shader":"t /= 500\nif (a == 0) { r = g = b = x; t /= -3 }\nvar waveWidth = ((cos(t)/sin(t) - 0.5) * 100) /4\n\nlineSize = 5.0\nvar color = sin(t)*100;\nr -= color * abs(sin((x - (t * 50.0) - (sin(t * 0.2) * 60.0)) * 0.2))\ng -= color * abs(sin(((x + (2.0 * 3.14)) - (t * 50.0) - (sin(t * 0.4) * 60.0)) * 0.2))\nb -= color * abs( sin( ( x - (2.0 * 3.14) - (t * 50.0) - (sin(t * 1.0) * 60.0)) * 0.2 ) );\nif(r&g&b){a = abs(sin(y)*1000)+t}else{a=1000}\n//if(r&g&b){a = abs(sin(y)*1000)-t}else{a=1000}"},{"name":"pepper","shader":"t/=6000000\npx = x/100 - 1\npy = y/(100) -1\nsx = 0.8 * px -py * sin( abs(sin(x/abs(sin(t)))) * px - 5000. * t);\ndy = 1./ (abs(py - sx) );\ndy += (py - (px))*50;\nr += (px + 0.5) * dy \ng = abs(sin(t))*0.9 * dy \nb = dy\na =1000"},{"name":"bouncy","shader":"\nu=(x + sin(t/100+y/20)*10)\nv=(y + sin(t/100+x/20)*10)\nrgbpixel(d,u,v)"},{"name":"morris one","shader":"zz = pow( norm(r*1.2,0,255) , r/55 )\nr = lerp( zz , 18, 237 )\ng = lerp( zz , 10, 123 )\nb = lerp( zz , 43, 118 )"}, +{"name":"morris two","shader":"zz = pow( norm((255-r)*1.2,0,255) , r/55 )\nr = lerp( zz , 18, 237 )\ng = lerp( zz , 10, 123 )\nb = lerp( zz , 43, 118 )"},{"name":"dots","shader":"t /= 700\nx=(t+x/2)|0\ny=(t+y/2)|0\nif (!(x%2) && !(y%2)) gray(x+y)\nelse gray(b+g+r)\na+=cosp(t*1)*30"}] |
