-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
71 lines (63 loc) · 1.59 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<html>
<head>
<title>Cyber Tanks</title>
<script src="socket.io.js"></script>
<script src="glMatrix-0.9.5.min.js"></script>
<script src="tedge.js"></script>
<script src="meshes.js"></script>
<script src="game.js"></script>
<script>
var singleplayer = false;
</script>
<!-- standard textured shaders -->
<script id="shader-fs" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
varying vec2 vTextureCoord;
varying vec4 vColor;
varying float vTexScale;
varying float vPulse;
uniform sampler2D uSampler;
void main(void)
{
gl_FragColor = (texture2D(uSampler, vTextureCoord * vTexScale)
+ texture2D(uSampler, vTextureCoord * vTexScale * 10.0) * vPulse)
* vColor;
}
</script>
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec3 aVertexPosition;
attribute vec2 aTextureCoord;
uniform mat4 uWMatrix;
uniform mat4 uVMatrix;
uniform mat4 uPMatrix;
uniform vec4 uColor;
uniform float uTexScale;
uniform float uPulse;
varying vec2 vTextureCoord;
varying vec4 vColor;
varying float vTexScale;
varying float vPulse;
void main(void) {
gl_Position = uPMatrix * uVMatrix * uWMatrix * vec4(aVertexPosition, 1.0);
vTextureCoord = aTextureCoord;
vColor = uColor;
vTexScale = uTexScale;
vPulse = uPulse;
}
</script>
<style>
#game {
position: absolute;
top: 0;
left: 0;
border: none;
}
</style>
</head>
<body onload="run();">
<canvas id="game" width="100%" height="100%">
</canvas>
</body>
</html>