blob: dcf7a9c7ce756165fc2999b2469d6fe1dc760358 (
plain)
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
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>LLLLColonq ShaderVerse Prime: The NEXTus (shado-realm)</title>
<link rel="icon" href="./assets/mrgreen.png">
<link rel="stylesheet" type="text/css" href="./main.css">
<script type="module">
CONFIG_SUBST
globalThis.mode = "throwshade";
</script>
<script type="module">
import init, * as bindings from "./newton/throwshade.js";
const wasm = await init({ module_or_path: "./newton/throwshade.wasm" });
window.wasmBindings = bindings;
console.log("initialized, starting...");
window.wasmBindings.main_js();
function resizeCanvas() {
let canvas = document.getElementById("teleia-parent").firstChild;
if (canvas) {
canvas.width = 1920;
canvas.height = 1080;
} else {
setTimeout(resizeCanvas, 50);
}
}
resizeCanvas();
</script>
<script type="module" src="./main.js"></script>
</head>
<body id="lcolonq-throwshade">
<div id="teleia-parent" class="lcolonq-throwshade-canvas"></div>
<div id="lcolonq-throwshade-bottom">
<div id="lcolonq-throwshade-bottom-left">
<textarea id="lcolonq-throwshade-textarea">
// how to:
// the parameter "cs" is a screen coordinate - it ranges from (0, 0) in the top left
// to (1.0, 1.0) in the bottom right
// available uniforms:
// float time - time in seconds since shader started
// vec2 resolution - display resolution in pixels (it's 1920x1080 :3)
// float chat_time - timestamp (in seconds since shader started) of last chat message
vec4 shade(vec2 cs) {
return vec4(0.0, 1.0, 0.0, 1.0);
}
</textarea>
</div>
<div id="lcolonq-throwshade-bottom-right">
<img id="lcolonq-throwshade-button-test" src="./assets/test.gif"></img>
<img id="lcolonq-throwshade-button-submit" src="./assets/upload.gif"></img>
</div>
</div>
</body>
</html>
|