forked from shawnlawson/The_Force
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
454 lines (445 loc) · 20.6 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
<!DOCTYPE HTML>
<html>
<head>
<title>- - --== The Force ==-- - -</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<link rel="icon" href="img/favicon.png">
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="css/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript" src="lib/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="lib/jquery-ui.min.js"></script>
<script type="text/javascript" src="lib/fpsmeter.js"></script>
<script type="text/javascript" src="lib/ace/ace.js"></script>
<script type="text/javascript" src="lib/ace/ext-language_tools.js"></script>
<script type="text/javascript" src="lib/ace/ext-static_highlight.js"></script>
<script type="text/javascript" src="lib/FileSaver.js"></script>
<script type="text/javascript" src="lib/canvas-toBlob.js"></script>
<script type="text/javascript" src="lib/osc.js"></script>
<script src="http://connect.soundcloud.com/sdk.js"></script>
<script type="text/javascript" src="js/openGL.js"></script>
<script type="text/javascript" src="js/oscManager.js"></script>
<script type="text/javascript" src="js/pageGlobals.js"></script>
</head>
<body>
<!-- editor =================================================================================== -->
<div id="editor"></div>
<!-- audio =================================================================================== -->
<div id="audioPanel" title="Audio Input">
<div id="audioTabs" class="myTabs">
<ul>
<li><a href="#tabs-1">None</a></li>
<li><a href="#tabs-2">Mic/Line</a></li>
<li><a href="#tabs-3">Server</a></li>
<li><a href="#tabs-4">File</a></li>
<li><a href="#tabs-5">SoundCloud</a></li>
</ul>
<div id="tabs-1">
<input type="submit" id="soundOffButton" value="all audio off" />
</div>
<div id="tabs-2">
<input type="submit" id="micToggleButton" value="start microphone/line in" />
<input type="checkbox" id="micTogglePlaythrough">
<label for="micTogglePlaythrough">playthrough</label>
</div>
<div id="tabs-3">
<input type="submit" id="myAudioServer" value="load file" />
<input type="checkbox" id="myAudioServerLoop" value="loop" />
<label for="myAudioServerLoop">loop</label>
</div>
<div id="tabs-4">
<input type="file" id="myAudioFile" accept="audio/*" />
<input type="checkbox" id="myAudioFileLoop" value="loop" />
<label for="myAudioFileLoop">loop</label>
</div>
<div id="tabs-5">
<div id="trackInfoPanel">
<img id="infoImage" src="">
<div id="infoArtist"></div>
<div id="infoTrack"></div>
</div>
<div id="playerControls">
<form id="form">
<input id="input" placeholder="Paste Soundcloud URL here (https://soundcloud.com/artist/track)">
<button type="submit" id="submit">load</button>
<br>
</form>
<audio id="player" crossorigin="anonymous" controls="" autoplay="" preload autobuffer></audio>
</div>
<div id="messageBox">
</div>
</div>
</div>
</div>
<!-- textures =================================================================================== -->
<div id="texturePanel" title="Textures" class="texTable">
<div class="tRow">
<div class="texCell">
<p>Slots</p>
</div>
<div class="texCell">
<p>Options</p>
</div>
</div>
<div class="tRow">
<div class="texCell" title="texture channel 0">
<img id="texture0" value="0" class="textureSlot" src="presets/previz/void.png" />
</div>
<!-- none, keyboard, webcam, audio -->
<div class="texCell" title="no texture">
<img id="tex_none" class="textureOption" src="presets/previz/void.png" />
</div>
<div class="texCell" title="keyboard">
<img id="tex_keyboard" class="textureOption" src="presets/previz/keyboard.png" />
</div>
<div class="texCell" title="webcam">
<img id="tex_webcam" class="textureOption" src="presets/previz/webcam.png" />
</div>
<div class="texCell" title="audio">
<img id="tex_audio" class="textureOption" src="presets/previz/audio.png" />
</div>
</div>
<div class="tRow">
<div class="texCell" title="texture channel 1">
<img id="texture1" class="textureSlot" src="presets/previz/void.png" />
</div>
<!-- bw noise, color noise, , -->
<div class="texCell" title="noise bw">
<img id="tex_noisebw" class="textureOption" src="presets/previz/noisebw.png" />
</div>
<div class="texCell" title="noise rgb">
<img id="tex_noisecolor" class="textureOption" src="presets/previz/noisecolor.png" />
</div>
<div class="texCell" title="nyan animation">
<img id="tex_nyan" class="textureOption" src="presets/previz/nyanIcon.png" />
</div>
<div class="texCell">
<img id="" class="textureOption" src="" />
</div>
</div>
<div class="tRow">
<div class="texCell" title="texture channel 2">
<img id="texture2" class="textureSlot" src="presets/previz/void.png" />
</div>
<div class="texCell">
<img id="" class="textureOption" src="" />
</div>
<div class="texCell">
<img id="" class="textureOption" src="" />
</div>
<div class="texCell">
<img id="" class="textureOption" src="" />
</div>
<div class="texCell">
<img id="" class="textureOption" src="" />
</div>
</div>
<div class="tRow">
<div class="texCell" title="texture channel 3">
<img id="texture3" class="textureSlot" src="presets/previz/void.png" />
</div>
<div class="texCell">
<img id="" class="textureOption" src="" />
</div>
<div class="texCell">
<img id="" class="textureOption" src="" />
</div>
<div class="texCell">
<img id="" class="textureOption" src="" />
</div>
<div class="texCell">
<img id="" class="textureOption" src="" />
</div>
</div>
</div>
<!-- edge blending =================================================================================== -->
<div id="edgesPanel" title="Projection Mapping -- Probably shouldn't use this">
<form>
<div id="radio">
<input type="radio" id="radio1" name="radio" value="1" checked="checked">
<label for="radio1">Single Screen</label>
<!-- <input type="radio" id="radio2" name="radio"><label for="radio2">Choice 2</label> -->
<input type="radio" id="radio3" name="radio" value="3">
<label for="radio3">Triple Screen</label>
</div>
</form>
<button id="testImage">Test Image</button>
<button id="loadMapping">Load Mapping</button>
<button id="saveMapping">Save Mapping</button>
<div id="edgesValues">
<p>left</p>
<input type="number" id="point1X" value="0.0" step="0.01" />
<input type="number" id="point1Y" value="0.0" step="0.01" />
<input type="number" id="scale1X" value="1.0" step="0.01" />
<input type="number" id="scale1Y" value="1.0" step="0.01" />
<input type="number" id="rotate1" value="0.0" step="0.01" />
<br />
<input type="number" id="blend1X" value="0.0" step="0.01" />
<input type="number" id="blend1Y" value="0.001" step="0.01" />
<input type="number" id="blend1Z" value="0.3" step="0.01" />
<input type="number" id="blend1W" value="0.01" step="0.01" />
<br />
<p>center</p>
<input type="number" id="point2X" value="0.0" step="0.01" />
<input type="number" id="point2Y" value="0.0" step="0.01" />
<input type="number" id="scale2X" value="1.0" step="0.01" />
<input type="number" id="scale2Y" value="1.0" step="0.01" />
<input type="number" id="rotate2" value="0.0" step="0.01" />
<br />
<input type="number" id="blend2X" value="0.3" step="0.01" />
<input type="number" id="blend2Y" value="0.01" step="0.01" />
<input type="number" id="blend2Z" value="0.6" step="0.01" />
<input type="number" id="blend2W" value="0.01" step="0.01" />
<br />
<p>right</p>
<input type="number" id="point3X" value="0.0" step="0.01" />
<input type="number" id="point3Y" value="0.0" step="0.01" />
<input type="number" id="scale3X" value="1.0" step="0.01" />
<input type="number" id="scale3Y" value="1.0" step="0.01" />
<input type="number" id="rotate3" value="0.0" step="0.01" />
<br />
<input type="number" id="blend3X" value="0.6" step="0.01" />
<input type="number" id="blend3Y" value="0.01" step="0.01" />
<input type="number" id="blend3Z" value="1.0" step="0.01" />
<input type="number" id="blend3W" value=".0001" step="0.01" />
</div>
</div>
<!-- osc =================================================================================== -->
<div id="oscPanel" title="OSC Websocket">
<p>OSC Websocket</p>
<input type="text" id="socket_address" value="localhost" class="hide" />
<input type="text" id="socket_port" value="8000" class="hide" />
<input type="submit" id="socket_start" value="Start" />
<input type="submit" id="socket_stop" value="Stop" />
<span id="socket_status">offline</span>
<p>Listenting to - localhost:8000</p>
<div id="myInputs">
<input type="submit" id="appendOSCInput" value="Add Input" />
<br />
<br />
</div>
<p>Sending to - localhost:7600</p>
<div id="myOutputs">
<input type="submit" id="appendOSCOutput" value="Add Output" />
<br />
<br />
</div>
</div>
<!-- osc =================================================================================== -->
<div id="colorCorrectPanel" title="Color Correction">
<p>
<label for="gammaAmount">Gamma:</label>
<input type="text" id="gammaAmount">
</p>
<div id="gammaSlider"></div>
<p>
<label for="redAmount">Red:</label>
<input type="text" id="redAmount">
</p>
<div id="redSlider"></div>
<p>
<label for="greenAmount">Green:</label>
<input type="text" id="greenAmount">
</p>
<div id="greenSlider"></div>
<p>
<label for="blueAmount">Blue:</label>
<input type="text" id="blueAmount">
</p>
<div id="blueSlider"></div>
</div>
<!-- FUNCTION REFERENCE =================================================================================== -->
<div id="helpPanel" title="Function Reference">
<div id="helpTabs" class="myTabs">
<ul>
<li><a href="#tabsHelp-1">Colors</a></li>
<li><a href="#tabsHelp-2">Uniforms</a></li>
<li><a href="#tabsHelp-3">Addons</a></li>
<li><a href="#tabsHelp-4">Math</a></li>
<li><a href="#tabsHelp-5">GL</a></li>
<li><a href="#tabsHelp-6">Snippets</a></li>
<li><a href="#tabsHelp-7">Info</a></li>
</ul>
<div id="tabsHelp-1">
<pre class="codeHighlight" ace-mode="ace/mode/glsl" ace-theme="ace/theme/monokai">
black = vec3(0.0);
white = vec3(1.0);
red = vec3(0.86,0.22,0.27);
orange = vec3(0.92,0.49,0.07);
yellow = vec3(0.91,0.89,0.26);
green = vec3(0.0,0.71,0.31);
blue = vec3(0.05,0.35,0.65);
purple = vec3(0.38,0.09,0.64);
pink = vec3(.9,0.758,0.798);
lime = vec3(0.361,0.969,0.282);
teal = vec3(0.396,0.878,0.878);
</pre>
</div>
<div id="tabsHelp-2">
<pre class="codeHighlight" ace-mode="ace/mode/glsl" ace-theme="ace/theme/monokai">
resolution = vec2(canvas width, canvas height); // value in pixels,
// divided by pixel
// size
time = float; // system time
<!-- channelTime[4] -->
mouse = vec4(mouse X, mouse Y, mouse click X, mouse click Y);
date = vec4();
<!-- channelResolution[4] -->
bands = vec4(low, mid-low, mid-high, high) // FFT results
backbuffer = texture2D; // previous render frame
</pre>
</div>
<div id="tabsHelp-3">
<pre class="codeHighlight" ace-mode="ace/mode/glsl" ace-theme="ace/theme/monokai">
PI = 3.14159;
PI2 = 6.28318;
uv() = vec2(x, y); // This pixel on screen when
// coordinate system is: width
// -width/height to width/height, height -1.0 to 1.0;
// center of canvas is origin
uvN() = vec2(x, y); // this pixel on screen when
// coordinate system is: width
// 0.0 to 1.0, height 0.0 to 1.0;
// bottom-left of canvas is origin
noise( vec2 ) = float // noise 0.0 to 1.0
snoise( vec2 ) = float // signed noise -1.0 to 0.0
// returns random values -1.0 to 1.0
rand( float ) = float // returns random values 0.0 to 1.0
rand( vec2 ) = vec2(0.0 to 1.0, 0.0 to 1.0);
fractal( vec2 ) = float // return random values 0.0 to 1.0
turbulence( vec2,
float octaves ) = float //returns random values 0.0 to 1.0
voronoi( vec2 ) = float // returns 0.0 to 1.0 with a smooth
// voronoi pattern
hsv2rgb( vec3 ) = vec3 // convert hue, saturation, value to
// red, green, blue
rotate(vec2 pivot,
vec2(x, y),
float amount)
box(vec2(x, y),
vec2(width, height),
float corner-roundness,
float edge-feathering);
circle(float x,
float y,
float radius,
float edge-feathering)
</pre>
</div>
<div id="tabsHelp-4">
<pre class="codeHighlight" ace-mode="ace/mode/glsl" ace-theme="ace/theme/monokai">
// list of common gles math functions
radians(x) // degrees to radians
degrees(x) // radians to degrees
sin(x) // sine of angle
cos(x) // cosine of angle
tan(x) // tangent of angle
asin(x) // arc sine of angle
acos(x) // arc cosine of angle
atan(y, x) // arc tangent of (y, x)
atan(y_over_x) // arc tangent of y/x
mamatrixCompMult(max, may) // multiply x by y component-wise
pow(x, y) // x to y exponent; x^y
exp(x) // ex
log(x) // natural log
exp2(x) // 2x
log2(x) // log base 2
sqrt(x) // square root; x^(1/2)
inversesqrt(x) // inverse square root; 1/(x^(1/2))
abs(x) // absolute value
sign(x) // returns -1.0, 0.0, or 1.0
floor(x) // nearest integer less than x
ceil(x) // nearest integer greater than x
fract(x) // x - floor(x)
mod(x, y) // modulus
min(x, y) // minimum value
max(x, y) // maximum value
clamp(x, // keep x between minVal and maxVal
minVal,
maxVal)
mix(x, y, a) // linear blend of x and y using a. (lerp)
step(edge, x) // 0.0 if x less than edge, else 1.0
smoothstep(edge0, // clip and smooth
edge1,
x)
</pre>
</div>
<div id="tabsHelp-5">
<pre class="codeHighlight" ace-mode="ace/mode/glsl" ace-theme="ace/theme/monokai">
gl_FragCoord = vec4(x, y, z, w) // fragment position within
// frame buffer window coordinates
gl_FragColor = vec4(r, g, b, a) // fragment color
texture2D(tex, vec2) = vec4(r, g, b, a) // tex is a texture: channel0 ...
// channel3 or backbuffer
</pre>
</div>
<div id="tabsHelp-6">
<pre class="codeHighlight" ace-mode="ace/mode/glsl" ace-theme="ace/theme/monokai">
forf = for(float i = 0.0; i < float; i++){
}
fori = for(int i = 0; i < int; i++){
}
iff = if(false){
}
vc = vec2
vvc = vec3
ft = float
</pre>
</div>
<div id="tabsHelp-7">
<pre class="codeHighlight" ace-mode="ace/mode/glsl" ace-theme="ace/theme/monokai">
// Created by: Shawn Lawson, http://shawnlawson.com
// Github Respository: https://github.com/shawnlawson/The_Force
</pre>
</div>
</div>
</div>
<!-- footer UI =================================================================================== -->
<div id="footer">
<div id="myFrameRate"></div>
<canvas id="fourBands" width="100" height="32"></canvas>
<div id="audioClock"></div>
<div id="footerUI">
<div id="selectQualityDIV" class="uiButton" title="Pixel Size">
<select id="selectQuality">
<option value="0.5">.5</option>
<option value="1">1</option>
<option value="2" selected="selected">2</option>
<option value="4">4</option>
<option value="8">8</option>
</select>
</div>
<div id="selectFontSizeDIV" class="uiButton" title="Text Size">
<select id="selectFontSize">
<option value="10">10</option>
<option value="12" selected="selected">12</option>
<option value="14">14</option>
<option value="16">16</option>
<option value="18">18</option>
<option value="24">24</option>
</select>
</div>
<input type="submit" id="audioButton" value="" class="uiButton" title="Audio Input" />
<input type="checkbox" id="debug" value="" />
<label for="debug" class="uiButton" title="Toggle Debugging"></label>
<input type="submit" id="texturing" value="" class="uiButton" title="Texture Panel" />
<input type="submit" id="edges" value="" class="uiButton" title="Projection Mapping Panel" />
<input type="file" id="mySettings" class="hide" />
<input type="submit" id="network" value="" class="uiButton" title="OSC Panel" />
<input type="submit" id="colorCorrectButton" value="" class="uiButton" title="Color Correction Panel" />
<input type="submit" id="openFile" value="" class="uiButton" title="Open Shader File" />
<input type="file" id="myFile" class="hide" />
<input type="submit" id="saveFile" value="" class="uiButton" title="Save Shader File" />
<input type="submit" id="saveImage" value="" class="uiButton" title="Save PNG" />
<input type="checkbox" id="play" value="" />
<label for="play" class="uiButton" title="Toggle Rendering"></label>
<input type="submit" id="funcButton" value="" class="uiButton" title="Function Reference" />
<input type="checkbox" id="myFullScreen" value="" />
<label for="myFullScreen" class="uiButton" title="Toggle Fullscreen"></label>
</div>
</div>
<!-- canvas =================================================================================== -->
<canvas id="demogl"></canvas>
</body>
</html>