summaryrefslogtreecommitdiff
path: root/templates/api/throwshade.html
blob: bf90832b8e86848b73fb6fbfa12eb19785590037 (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
56
57
58
59
60
61
62
63
64
<!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="./assets/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-body">
      <div 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:
// vec2 resolution - display resolution in pixels (it's 1920x1080 :3)
// float time - time in seconds since shader started
// float chat_time - timestamp (in seconds since shader started) of last chat message
// float tracking_mouth - how open my mouth is (1.0 = Fully Open, 0.0 = Fully Antiopen)
// vec2 tracking_eyes - how open each eye is (1.0 = Fully Open Also)
// vec2 emacs_cursor - position of my emacs cursor on screen (in pixels)
// vec2 mouse_cursor - position of my mouse cursor on screen (in pixels)
// int heartrate - current rate at which my heart is beating (in Hz)
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>
      </div>
      <pre id="lcolonq-throwshade-current">
        hiiiiiiiii
      </pre>
    </body>
</html>