-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
54 lines (46 loc) · 1.24 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
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Example WebGl</title>
<style>
*, *::before, *::after {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
text-align: center;
overflow: hidden;
background-color: black;
}
</style>
</head>
<body>
<script id="fragment_shader" type="x-shader/x-fragment">
precision mediump float;
varying vec2 v_texcoord;
uniform sampler2D u_texture;
void main() {
gl_FragColor = texture2D(u_texture, v_texcoord);
}
</script>
<script id="vertex_shader" type="x-shader/x-vertex">
attribute vec4 a_position;
attribute vec2 a_texcoord;
uniform mat4 u_matrix;
varying vec2 v_texcoord;
void main() {
gl_Position = u_matrix * a_position;
v_texcoord = a_texcoord;
}
</script>
<script type="text/javascript" src="src/gl-matrix.js"></script>
<script type="text/javascript" src="src/core.js"></script>
<script type="text/javascript" src="src/timer.js"></script>
<script type="text/javascript" src="src/renderer.js"></script>
<script type="text/javascript" src="src/shaders.js"></script>
<script type="text/javascript" src="src/texture.js"></script>
<script type="text/javascript" src="src/main.js"></script>
</body>
</html>