-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
45 lines (41 loc) · 1.25 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
<!DOCTYPE html>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<html lang="en">
<head>
<link href="style.css" rel="stylesheet" type="text/css">
<script type="x-shader/x-vertex" id="vertex-shader">
attribute vec3 position;
void main() {
gl_Position = vec4(position, 1.0 );
}
</script>
<script type="x-shader/x-vertex" id="fragment-shader">
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 resolution;
bool close_to(float a, float b, float margin) {
if(a < b+margin && a > b-margin) {
return true;
}
return false;
}
void main() {
vec2 pos = gl_FragCoord/resolution;
if(close_to(pow(pos.x, 2), pos.y, 1.0)) {
gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
} else {
gl_FragCOLor = vec4(0.0, 0.0, 0.0, 1.0);
}
}
</script>
<script src="./glut.js"></script>
<script src="./index.js"></script>
</head>
<body>
<canvas id="glCanvas" style="width:100%; height:100%"></canvas>
<div class="center">
maxobe's quirky and awesome site
</body>
</html>