-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrender-test.html
More file actions
49 lines (38 loc) · 2.21 KB
/
Copy pathrender-test.html
File metadata and controls
49 lines (38 loc) · 2.21 KB
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
<html>
<head>
<meta charset="UTF-8">
<style>
body, button {
box-sizing: border-box;
background: black;
color: orange;
}
</style>
<script src="randomart-glsl.js"></script>
<script type="text/javascript">
const capturer = {
addFrame: (frame) => {}
};
function init() {
let canvas = document.getElementById("glCanvas");
let formula = document.getElementById("txtFormula");
//formula.value = 'Sin(0.3962, 5.1739, Sin(1.7626, 4.3320, Sum(Not(Mix(frmT, posY, Const(0.9922, 0.8672, 0.6484))), Tent(Mul(posX, frmT)))))';
formula.value = 'Sin(0.1526, 2.3605, Sin(0.2446, 3.6360, Sum(Tent(Sum(Sum(Const(0.9531, 0.6250, 0.0703), posY), Well(frmT))), Mul(Mod(Mod(Const(0.9922, 0.2188, -0.2891), posX), Not(posX)), Well(Mod(posX, posX))))))'
//formula.value = 'Sin(0.2504, 1.7638, Mix(Mix(Level(0.3273, Mix(Not(posY), Well(posY), Well(posY)), Mod(Sin(2.7225, 3.1841, posY), Sum(posY, posX)), Sin(1.0080, 4.0918, Mul(posX, Const(0.0000, 0.3125, 0.3125)))), Sin(0.3245, 1.9311, Tent(Mix(posX, posY, BW(0.3425)))), Mix(Sin(2.3354, 1.9112, RGB(posX, frmT, posY)), Tent(Well(posX)), Well(Sin(2.8899, 2.8151, Const(-0.5441, -0.4263, -0.7413))))), Sum(Tent(RGB(RGB(Const(-0.6769, 0.9450, -0.0314), Const(0.3486, 0.4346, 0.4358), Const(0.1250, 0.2266, 0.2344)), Not(posX), Level(-0.3766, posY, frmT, posY))), Level(-0.1712, Mix(Mod(posY, Const(0.3125, 0.0938, 0.0938)), Well(Const(0.9922, -0.8984, -0.3672)), Sum(posY, Const(-0.0469, 0.0938, 0.0703))), RGB(RGB(frmT, posY, Const(0.0000, 0.3125, 0.3125)), Mod(posX, Const(0.5489, -0.5102, -0.9774)), Mod(frmT, posY)), Tent(RGB(posX, posY, Const(0.1250, 0.2266, 0.2344))))), Sin(2.2833, 4.0931, Sin(2.2698, 2.8887, Not(Mod(posX, posY))))))'
render_glsl(canvas, formula.value, true);
formula.onkeypress = function(e) {
if (e.keyCode == 13) {
render_glsl(canvas, formula.value, true);
return false;
}
return true;
};
}
</script>
</head>
<body onload="init()">
<textarea id="txtFormula" rows="10" cols="140"></textarea>
<br>
<canvas id="glCanvas" width="768" height="768">
</body>
</html>