-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
40 lines (30 loc) · 902 Bytes
/
index.html
File metadata and controls
40 lines (30 loc) · 902 Bytes
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
<!DOCTYPE html>
<meta charset="UTF-8">
<html>
<head>
<title> Testing Out WebGL</title>
<script type="text/javascript" src="gl-matrix.js"></script>
<script type="text/javascript" src="webgl.js"></script>
<script id="shader-fs" type="x-shader/x-fragment">
precision mediump float;
varying vec2 vTextCoord;
uniform sampler2D sampler;
void main(void) {
gl_FragColor = texture2D(sampler, vec2(vTextCoord.s, vTextCoord.t));
}
</script>
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec3 VertexPosition;
attribute vec2 TextCoord;
uniform mat4 mvMatrix;
uniform mat4 pMatrix;
varying vec2 vTextCoord;
void main(void) {
gl_Position = pMatrix * mvMatrix * vec4(VertexPosition, 1.0);
vTextCoord = TextCoord;
}
</script>
</head>
<body onload="main()">
<canvas id="webglCanvas" width="500" height="500"></canvas>
</html>