nothing-simulator/docs/index.html

71 lines
2.3 KiB
HTML
Raw Normal View History

2025-03-04 05:04:38 -05:00
<!DOCTYPE html>
<html lang="en">
<head>
2025-03-04 12:31:51 -05:00
<meta charset="utf-8" />
2025-03-06 21:53:12 -05:00
<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1">
2025-03-06 11:31:30 -05:00
<title>Nilgrinder: Nothing to Everything</title>
2025-03-04 12:31:51 -05:00
<script id="vertex-shader-2d" type="notjs">
2025-03-04 05:04:38 -05:00
// an attribute will receive data from a buffer
attribute vec4 a_position;
varying vec4 b_position;
uniform mat4 mat_thing;
2025-03-04 12:31:51 -05:00
uniform mat4 mvp_thing;
2025-03-04 05:04:38 -05:00
// all shaders have a main function
2025-03-05 01:00:00 -05:00
void main() {
2025-03-04 05:04:38 -05:00
// gl_Position is a special variable a vertex shader
// is responsible for setting
2025-03-04 12:31:51 -05:00
gl_Position = mat_thing * mvp_thing * a_position ;
2025-03-04 05:04:38 -05:00
b_position = a_position;
}
</script>
2025-03-04 12:31:51 -05:00
<script id="fragment-shader-2d" type="notjs">
2025-03-04 05:04:38 -05:00
// fragment shaders don't have a default precision so we need
// to pick one. mediump is a good default
precision mediump float;
varying vec4 b_position;
uniform float size_thing;
uniform float dist_thing;
2025-03-04 12:31:51 -05:00
uniform bool is_fg;
2025-03-04 05:04:38 -05:00
void main() {
// gl_FragColor is a special variable a fragment shader
// is responsible for setting
2025-03-04 12:31:51 -05:00
if (is_fg) {
2025-03-12 20:54:20 -04:00
gl_FragColor = vec4(b_position.xyz,1.0) * 0.5 + vec4(1.0,1.0,1.0,1.0) * 0.5;
2025-03-04 12:31:51 -05:00
return;
}
2025-03-06 19:15:23 -05:00
float dist = (log(distance(b_position.xy,vec2(0.0))) - size_thing) / log(2.0) * 0.1;
2025-03-12 20:54:20 -04:00
dist = mod(dist,0.1);
dist = abs(dist - 0.05) + 0.05;
gl_FragColor = vec4((mod(dist,0.1) - 0.1 + 0.1 * dist_thing) * 50.0 * vec3(1,1,1),1);
2025-03-04 05:04:38 -05:00
}
</script>
2025-03-04 12:31:51 -05:00
2025-03-10 05:31:47 -04:00
<script src="/js/num.js"></script>
2025-03-04 12:31:51 -05:00
<script src="/js/cube.js"></script>
<script src="/js/mat.js"></script>
2025-03-04 22:32:32 -05:00
<script src="/js/twgl.min.js"></script>
<script src="/js/idle.js" defer></script>
<script src="/js/index.js" defer></script>
2025-03-05 01:10:20 -05:00
<script src="/js/upgrade.js" defer></script>
2025-03-04 12:31:51 -05:00
<link rel="stylesheet" href="main.css">
2025-03-04 05:04:38 -05:00
</head>
<body>
2025-03-04 12:31:51 -05:00
<canvas id="c" width="640" height="480"></canvas>
<div class='hud'>
2025-03-05 13:53:35 -05:00
<b>Nilgrinder: Nothing to Everything</b>
<div class='item'><a href='https://dervland.net/'>More Games</a></div>
2025-03-12 15:06:53 -04:00
<div class='item'><a href='https://discord.gg/Wkr7PVk3cF'>Chat</a></div>
2025-03-05 01:10:20 -05:00
<div class='main-hud'>hud</div>
2025-03-04 12:31:51 -05:00
</div>
2025-03-04 05:04:38 -05:00
</body>
</html>