-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
668 lines (603 loc) · 20.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
<html>
<head>
<title>Dynamic Color</title>
<meta charset="utf-8">
<style>
body { margin: 0; }
canvas { width: 100%; height: 100% }
</style>
</head>
<body>
<!-- libs -->
<script src="three/three.min.js"></script>
<script src="jscolor/jscolor.js"></script>
<!-- consts -->
<script>
var WIDTH = 512;//+256+128;
</script>
<!-- pass through vertex shader -->
<script id="ptVertexShader" type="x-shader/x-vertex">
void main() {
gl_Position = vec4( position, 1.0 );
}
</script>
<!-- pass through fragment shader -->
<script id="ptFragmentShader" type="x-shader/x-fragment">
uniform vec2 resolution;
uniform sampler2D old;
void main() {
vec2 uv = gl_FragCoord.xy / resolution.xy;
gl_FragColor = vec4(texture2D( old, uv ));
}
</script>
<!-- show amount -->
<script id="amountFragmentShader" type="x-shader/x-fragment">
uniform vec2 resolution;
uniform sampler2D old;
void main() {
vec2 uv = gl_FragCoord.xy / resolution.xy;
vec4 color = texture2D( old, uv );
gl_FragColor = vec4( color.a );
}
</script>
<script id="BWShader" type="x-shader/x-fragment">
uniform vec2 resolution;
uniform sampler2D old;
void main() {
vec2 uv = gl_FragCoord.xy / resolution.xy;
vec4 color = texture2D( old, uv );
//our eyes see some colors more prominently
gl_FragColor = vec4( 0.27*color.r + 0.59*color.g + 0.14*color.b );
}
</script>
<!-- static shaders -->
<!-- rotation -->
<script id="Shader90" type="x-shader/x-fragment">
uniform vec2 resolution;
uniform sampler2D old;
void main() {
vec2 uv = gl_FragCoord.xy / resolution.xy;
vec2 pos = vec2(uv.y, -uv.x);
gl_FragColor = vec4(texture2D( old, pos ));
}
</script>
<script id="Shader180" type="x-shader/x-fragment">
uniform vec2 resolution;
uniform sampler2D old;
void main() {
vec2 uv = gl_FragCoord.xy / resolution.xy;
vec2 pos = vec2(-uv.x, -uv.y);
gl_FragColor = vec4(texture2D( old, pos ));
}
</script>
<script id="Shader270" type="x-shader/x-fragment">
uniform vec2 resolution;
uniform sampler2D old;
void main() {
vec2 uv = gl_FragCoord.xy / resolution.xy;
vec2 pos = vec2(-uv.y, uv.x);
gl_FragColor = vec4(texture2D( old, pos ));
}
</script>
<!-- mirror -->
<script id="ShaderHz" type="x-shader/x-fragment">
uniform vec2 resolution;
uniform sampler2D old;
void main() {
vec2 uv = gl_FragCoord.xy / resolution.xy;
vec2 pos = vec2(-uv.x, uv.y);
gl_FragColor = vec4(texture2D( old, pos ));
}
</script>
<script id="ShaderVt" type="x-shader/x-fragment">
uniform vec2 resolution;
uniform sampler2D old;
void main() {
vec2 uv = gl_FragCoord.xy / resolution.xy;
vec2 pos = vec2(uv.x, -uv.y);
gl_FragColor = vec4(texture2D( old, pos ));
}
</script>
<!-- dynamic -->
<script id="ShaderSpread" type="x-shader/x-fragment">
//width of textures
uniform vec2 resolution;
//previous values
//r,g,b,a = red, green, blue, amount
uniform sampler2D old;
//user position, request
uniform vec4 interact;
//interaction color
uniform vec4 icolor;
void main() {
//calculate 3x3 nearby positions and values
float l = (gl_FragCoord.x - 1.0) / resolution.x;
float m = (gl_FragCoord.x) / resolution.x;
float r = (gl_FragCoord.x + 1.0) / resolution.x;
float b = (gl_FragCoord.y - 1.0) / resolution.y;
float c = (gl_FragCoord.y) / resolution.y;
float t = (gl_FragCoord.y + 1.0) / resolution.y;
vec4 mt = texture2D( old, vec2(m, t));
vec4 lc = texture2D( old, vec2(l, c));
vec4 mc = texture2D( old, vec2(m, c));
vec4 rc = texture2D( old, vec2(r, c));
vec4 mb = texture2D( old, vec2(m, b));
vec3 col = mc.rgb;
float amount;
//spread
amount = clamp(mc.a, 0.0, 0.5);
float income = (
max((mt.a-0.5)*0.25,0.0) +
max((lc.a-0.5)*0.25,0.0) +
max((rc.a-0.5)*0.25,0.0) +
max((mb.a-0.5)*0.25,0.0)
);
amount += income;
//bleed (including through black)
if(amount < mt.a) col = mt.rgb;
if(amount < lc.a) col = lc.rgb;
if(amount < rc.a) col = rc.rgb;
if(amount < mb.a) col = mb.rgb;
//add some pixels at the mouse position
vec2 pix = vec2(interact.x - 0.5, interact.y - 0.5);
float sz = interact.a;
if(
icolor.a > 0.0 &&
pix.x + sz + 1.0 > gl_FragCoord.x &&
pix.y + sz + 1.0 > gl_FragCoord.y &&
pix.x - sz < gl_FragCoord.x &&
pix.y - sz < gl_FragCoord.y
){
float dist = distance(pix.xy,gl_FragCoord.xy);
if(dist<sz){
amount += icolor.a;
col = icolor.rgb;
}
}
gl_FragColor = vec4(col, amount);
}
</script>
<script id="ShaderDraw" type="x-shader/x-fragment">
uniform vec2 resolution;
uniform sampler2D old;
uniform vec4 interact;
uniform vec4 icolor;
void main() {
vec4 mc = texture2D( old, vec2(gl_FragCoord.xy / resolution.xy));
vec3 col = mc.rgb;
float amount = mc.a;
//add some pixels at the mouse position
vec2 pix = vec2(interact.x - 0.5, interact.y - 0.5);
float sz = interact.a;
if(
icolor.a > 0.0 &&
pix.x + sz + 1.0 > gl_FragCoord.x &&
pix.y + sz + 1.0 > gl_FragCoord.y &&
pix.x - sz < gl_FragCoord.x &&
pix.y - sz < gl_FragCoord.y
){
float dist = distance(pix.xy,gl_FragCoord.xy);
if(dist<sz){
amount = icolor.a;
col = icolor.rgb;
}
}
gl_FragColor = vec4(col, amount);
}
</script>
<script id="ShaderSpin" type="x-shader/x-fragment">
//width of textures
uniform vec2 resolution;
//previous values
//r,g,b,a = red, green, blue, amount
uniform sampler2D old;
//user position, request
uniform vec4 interact;
//interaction color
uniform vec4 icolor;
float ct = cos(0.15);
float st = sin(0.15);
void main() {
//calculate spin positions
float m = -0.5 + (gl_FragCoord.x) / resolution.x;
float c = -0.5 + (gl_FragCoord.y) / resolution.y;
vec2 mcp = vec2(m*ct-c*st, c*ct+m*st)+vec2(.5,.5);
vec4 mc = texture2D( old, mcp);
gl_FragColor = vec4(mc);
}
</script>
<script id="ShaderFall" type="x-shader/x-fragment">
uniform vec2 resolution;
uniform sampler2D old;
uniform vec4 interact;
uniform vec4 icolor;
void main() {
//calculate 3x3 nearby positions and values
float m = (gl_FragCoord.x) / resolution.x;
float b = (gl_FragCoord.y - 1.0) / resolution.y;
float c = (gl_FragCoord.y) / resolution.y;
float t = (gl_FragCoord.y + 1.0) / resolution.y;
vec4 mt = texture2D( old, vec2(m, t));
vec4 mc = texture2D( old, vec2(m, c));
vec4 mb = texture2D( old, vec2(m, b));
vec3 col = mc.rgb;
float amount = mc.a;
if(mb.a >= mc.a ){
//strong base
if(mt.a >= mc.a){
//top heavy
amount += mt.a;
col = vec3(mt.rgb);
}//else pyramid
}else{
//weak base
if(mt.a >= mc.a){
//known to fall
amount = mt.a;
col = vec3(mt.rgb);
}else{
//nothing above
amount = 0.0;
col = vec3(0.0,0.0,0.0);
}
}
gl_FragColor = vec4(col, amount);
}
</script>
<!-- util -->
<script>
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function getRenderTarget() {
var renderTarget = new THREE.WebGLRenderTarget(WIDTH, WIDTH, {
wrapS: THREE.RepeatWrapping,
wrapT: THREE.RepeatWrapping,
minFilter: THREE.NearestFilter,
magFilter: THREE.NearestFilter,
format: THREE.RGBAFormat,
type: THREE.FloatType,
stencilBuffer: false,
});
return renderTarget;
}
</script>
<!-- main -->
<script>
var renderer = new THREE.WebGLRenderer();
renderer.setSize( WIDTH, WIDTH);//window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
var texCam = new THREE.Camera();
texCam.position.z = 1;
var canvTex0 = getRenderTarget();
var canvTex1 = getRenderTarget();
var passThruShader = new THREE.ShaderMaterial( {
uniforms:{
resolution: { type: "v2", value: new THREE.Vector2( WIDTH, WIDTH ) },
old: { type: "t", value: null },
},
vertexShader: document.getElementById( 'ptVertexShader' ).textContent,
fragmentShader: document.getElementById( 'ptFragmentShader' ).textContent
} );
var amountShader = new THREE.ShaderMaterial( {
uniforms:{
resolution: { type: "v2", value: new THREE.Vector2( WIDTH, WIDTH ) },
old: { type: "t", value: null },
},
vertexShader: document.getElementById( 'ptVertexShader' ).textContent,
fragmentShader: document.getElementById( 'amountFragmentShader' ).textContent
} );
var BWShader = new THREE.ShaderMaterial( {
uniforms:{
resolution: { type: "v2", value: new THREE.Vector2( WIDTH, WIDTH ) },
old: { type: "t", value: null },
},
vertexShader: document.getElementById( 'ptVertexShader' ).textContent,
fragmentShader: document.getElementById( 'BWShader' ).textContent
} );
//static
var Shader90 = new THREE.ShaderMaterial( {
uniforms:{
resolution: { type: "v2", value: new THREE.Vector2( WIDTH, WIDTH ) },
old: { type: "t", value: null },
interact: { type: "v4", value: new THREE.Vector4() },
icolor: { type:"v4", value: new THREE.Vector4() },
},
vertexShader: document.getElementById( 'ptVertexShader' ).textContent,
fragmentShader: document.getElementById( 'Shader90' ).textContent
} );
var Shader180 = new THREE.ShaderMaterial( {
uniforms:{
resolution: { type: "v2", value: new THREE.Vector2( WIDTH, WIDTH ) },
old: { type: "t", value: null },
interact: { type: "v4", value: new THREE.Vector4() },
icolor: { type:"v4", value: new THREE.Vector4() },
},
vertexShader: document.getElementById( 'ptVertexShader' ).textContent,
fragmentShader: document.getElementById( 'Shader180' ).textContent
} );
var Shader270 = new THREE.ShaderMaterial( {
uniforms:{
resolution: { type: "v2", value: new THREE.Vector2( WIDTH, WIDTH ) },
old: { type: "t", value: null },
interact: { type: "v4", value: new THREE.Vector4() },
icolor: { type:"v4", value: new THREE.Vector4() },
},
vertexShader: document.getElementById( 'ptVertexShader' ).textContent,
fragmentShader: document.getElementById( 'Shader270' ).textContent
} );
var ShaderHz = new THREE.ShaderMaterial( {
uniforms:{
resolution: { type: "v2", value: new THREE.Vector2( WIDTH, WIDTH ) },
old: { type: "t", value: null },
interact: { type: "v4", value: new THREE.Vector4() },
icolor: { type:"v4", value: new THREE.Vector4() },
},
vertexShader: document.getElementById( 'ptVertexShader' ).textContent,
fragmentShader: document.getElementById( 'ShaderHz' ).textContent
} );
var ShaderVt = new THREE.ShaderMaterial( {
uniforms:{
resolution: { type: "v2", value: new THREE.Vector2( WIDTH, WIDTH ) },
old: { type: "t", value: null },
interact: { type: "v4", value: new THREE.Vector4() },
icolor: { type:"v4", value: new THREE.Vector4() },
},
vertexShader: document.getElementById( 'ptVertexShader' ).textContent,
fragmentShader: document.getElementById( 'ShaderVt' ).textContent
} );
//dynamic
var ShaderDraw = new THREE.ShaderMaterial( {
uniforms:{
resolution: { type: "v2", value: new THREE.Vector2( WIDTH, WIDTH ) },
old: { type: "t", value: null },
interact: { type: "v4", value: new THREE.Vector4() },
icolor: { type:"v4", value: new THREE.Vector4() },
},
vertexShader: document.getElementById( 'ptVertexShader' ).textContent,
fragmentShader: document.getElementById( 'ShaderDraw' ).textContent
} );
var ShaderSpread = new THREE.ShaderMaterial( {
uniforms:{
resolution: { type: "v2", value: new THREE.Vector2( WIDTH, WIDTH ) },
old: { type: "t", value: null },
interact: { type: "v4", value: new THREE.Vector4() },
icolor: { type:"v4", value: new THREE.Vector4() },
},
vertexShader: document.getElementById( 'ptVertexShader' ).textContent,
fragmentShader: document.getElementById( 'ShaderSpread' ).textContent
} );
var ShaderSpin = new THREE.ShaderMaterial( {
uniforms:{
resolution: { type: "v2", value: new THREE.Vector2( WIDTH, WIDTH ) },
old: { type: "t", value: null },
interact: { type: "v4", value: new THREE.Vector4() },
icolor: { type:"v4", value: new THREE.Vector4() },
},
vertexShader: document.getElementById( 'ptVertexShader' ).textContent,
fragmentShader: document.getElementById( 'ShaderSpin' ).textContent
} );
var ShaderFall = new THREE.ShaderMaterial( {
uniforms:{
resolution: { type: "v2", value: new THREE.Vector2( WIDTH, WIDTH ) },
old: { type: "t", value: null },
interact: { type: "v4", value: new THREE.Vector4() },
icolor: { type:"v4", value: new THREE.Vector4() },
},
vertexShader: document.getElementById( 'ptVertexShader' ).textContent,
fragmentShader: document.getElementById( 'ShaderFall' ).textContent
} );
var texScene = new THREE.Scene();
var texMesh = new THREE.Mesh( new THREE.PlaneBufferGeometry( 2, 2 ), passThruShader );
texScene.add(texMesh);
//doesn't work yet
// var lineScene = new THREE.Scene();
// var lineMat = new THREE.LineBasicMaterial();
// var lineGeom = new THREE.Geometry();
// var lineObj = new THREE.Line( lineGeom, lineMat );
// lineScene.add(lineObj);
//default
outShader = passThruShader;
// Takes a texture, and render out as another texture
var copyTexture = function ( input, output ) {
texMesh.material = passThruShader;
passThruShader.uniforms.old.value = input;
renderer.render( texScene, texCam, output );
}
//applies shader to input, writing to output and screen
var renderTick = function(input, shader, output) {
texMesh.material = shader;
shader.uniforms.old.value = input;
shader.uniforms.interact.value.set(mouseX,mouseY,mouseZ,mouseSize);
shader.uniforms.icolor.value.set(mouseRed,mouseGreen,mouseBlue,mouseDown?mouseAmount:0);
renderer.render( texScene, texCam, output );
}
//doesn't work yet
// var addLine = function(x1,y1,x2,y2,c){
// lineGeom.vertices = [
// new THREE.Vector3(x1,y1,0.0),
// new THREE.Vector3(x2,y2,0.0),
// ];
// lineGeom.verticesNeedUpdate = true;
// lineMat.color = c;
// var tex = flipflop ? canvTex0 : canvTex1;
// renderer.render( lineScene, texCam, tex);
// }
var renderFinal = function(shader){
var tex = flipflop ? canvTex0 : canvTex1;
texMesh.material = shader;
shader.uniforms.old.value = tex;
renderer.render( texScene, texCam);
}
var flipflop = false;
var calc = function(shader) {
if (flipflop) {
renderTick( canvTex1, shader, canvTex0 );
} else {
renderTick( canvTex0, shader, canvTex1 );
}
flipflop = !flipflop;
}
//initialize data
var a = new Float32Array( WIDTH * WIDTH * 4 );
var texture = new THREE.DataTexture( a, WIDTH, WIDTH, THREE.RGBAFormat, THREE.FloatType );
texture.minFilter = THREE.NearestFilter;
texture.magFilter = THREE.NearestFilter;
texture.needsUpdate = true;
texture.flipY = false;
copyTexture(texture, canvTex0);
//window.addEventListener( 'resize', onWindowResize, false );
document.addEventListener("keydown", onKeyDown, false);
document.addEventListener("keyup", onKeyUp, false);
document.addEventListener( 'mousemove', onMouseM, false );
document.addEventListener( 'mousedown', onMouseD, false );
document.addEventListener( 'mouseup', onMouseU, false );
//inital status
mouseDown = false;
mouseOldX = 0;
mouseOldY = 0;
mouseOldZ = 0;
mouseX = 0;
mouseY = 0;
mouseZ = 0;
mouseSize = 3.0;
mouseRed = 1.0;
mouseGreen = 1.0;
mouseBlue = 1.0;
mouseAmount = 1.0;
windowHalfX = window.innerWidth / 2;
windowHalfY = window.innerHeight / 2;
function onMouseM( event ) {
mouseOldX = mouseX;
mouseOldY = mouseY;
mouseX = event.clientX;
mouseY = WIDTH - event.clientY;
//not working
// if(mouseSize > 0.0){
// addLine(mouseOldX,mouseOldY,mouseX,mouseY,
// new THREE.Color(mouseRed,mouseGreen,mouseBlue));
// }
}
var randColor = true;
function onMouseD( event ) {
mouseDown = true;
if(randColor){
mouseRed = Math.random();
mouseGreen = Math.random();
mouseBlue = Math.random();
while(mouseRed+mouseGreen+mouseBlue < 0.6){
mouseRed = Math.random();
mouseGreen = Math.random();
mouseBlue = Math.random();
}
}else{
col = document.getElementById("color").value;
r = col.slice(0,2);
g = col.slice(2,4);
b = col.slice(4,6);
mouseRed = parseInt(r,16)/255;
mouseGreen = parseInt(g,16)/255;
mouseBlue = parseInt(b,16)/255;
}
}
function onMouseU( event ) {
mouseDown = false;
}
repeat = true;
function onKeyDown(){
repeat = !repeat;
if(!repeat){
//renderFinal(BWShader);
}
}
function onKeyUp(){
//repeat = true;
}
var cmdShader = passThruShader;
var framecount = 0;
var oldtime = new Date().getTime();
var cycleShaders = [ShaderSpread,ShaderSpread,ShaderSpread,ShaderSpread];
var cycle = function(index, shader){
cycleShaders[index] = shader;
}
var render = function () {
requestAnimationFrame( render );
if(repeat) {
//do static buttons first
if(cmdShader != passThruShader) {
calc(cmdShader);
cmdShader = passThruShader;
}
//then dynamic ones
for(var i = 0; i < cycleShaders.length; i++){
calc(cycleShaders[i]);
}
//then final filter
renderFinal(outShader);
//console frames per second
framecount++;
var newtime = new Date().getTime();
if(newtime-oldtime>1000){
oldtime = newtime;
console.log(framecount);
framecount = 0;
}
}
};
render();
</script>
<!-- controls -->
<div style='float: right'>
<!-- static controls -->
<button onclick='onKeyDown();'>Pause</button><br>
<button onclick='cmdShader=Shader90;'>90</button>
<button onclick='cmdShader=Shader180;'>180</button>
<button onclick='cmdShader=Shader270;'>270</button>
<button onclick='cmdShader=ShaderHz;'>horizontal</button>
<button onclick='cmdShader=ShaderVt;'>vertical</button>
<!-- dynamic controls -->
<table>
<tr><td>Stage</td><td>1</td><td>2</td><td>3</td><td>4</td></tr>
<tr><td>Draw</td>
<td><input type='radio' name='stage0' onclick='cycle(0,ShaderDraw);'/></td>
<td><input type='radio' name='stage1' onclick='cycle(1,ShaderDraw);'/></td>
<td><input type='radio' name='stage2' onclick='cycle(2,ShaderDraw);'/></td>
<td><input type='radio' name='stage3' onclick='cycle(3,ShaderDraw);'/></td>
</tr>
<tr><td>Spread</td>
<td><input checked type='radio' name='stage0' onclick='cycle(0,ShaderSpread);'/></td>
<td><input checked type='radio' name='stage1' onclick='cycle(1,ShaderSpread);'/></td>
<td><input checked type='radio' name='stage2' onclick='cycle(2,ShaderSpread);'/></td>
<td><input checked type='radio' name='stage3' onclick='cycle(3,ShaderSpread);'/></td>
</tr>
<tr><td>Spin</td>
<td><input type='radio' name='stage0' onclick='cycle(0,ShaderSpin);'/></td>
<td><input type='radio' name='stage1' onclick='cycle(1,ShaderSpin);'/></td>
<td><input type='radio' name='stage2' onclick='cycle(2,ShaderSpin);'/></td>
<td><input type='radio' name='stage3' onclick='cycle(3,ShaderSpin);'/></td>
</tr>
<tr><td>Fall</td>
<td><input type='radio' name='stage0' onclick='cycle(0,ShaderFall);'/></td>
<td><input type='radio' name='stage1' onclick='cycle(1,ShaderFall);'/></td>
<td><input type='radio' name='stage2' onclick='cycle(2,ShaderFall);'/></td>
<td><input type='radio' name='stage3' onclick='cycle(3,ShaderFall);'/></td>
</tr>
</table>
Filter<select onchange='eval(this.value)'>
<option selected value='outShader=passThruShader'>Color</option>
<option value='outShader=BWShader'>Black and White</option>
<option value='outShader=amountShader'>Amount</option>
</select>
<br>
Color:
<input type='checkbox' onclick='randColor=this.checked' checked>random</input><br>
<input id='color' class='color'></input><br>
Size:<input type='range' onchange='mouseSize=this.value'
max='20' min='1' defaultValue='3'>
</input><br>
Amount:<input type='range' onchange='mouseAmount=this.value'
max='2' min='0' step='0.1' defaultValue='1'>
</input><br>
</div>
</body>
</html>