forked from ou-sbselab/CSI4900-ComputerGraphics
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtriangle-shade.html
45 lines (38 loc) · 879 Bytes
/
triangle-shade.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>
<!--
triangle.html
Erik Fredericks, c/o Ed Angel
The triangular hello world of WebGL
-->
<html>
<head>
<meta charset="utf-8">
<!-- Define our shaders -->
<script id="vertex-shader" type="x-shader/x-vertex">
attribute vec4 vPosition;
attribute vec4 vColor;
varying vec4 fColor;
void main() {
gl_Position = vPosition;
fColor = vColor;
}
</script>
<script id="fragment-shader" type="x-shader/x-fragment">
precision mediump float;
varying vec4 fColor;
void main() {
gl_FragColor = fColor;
//gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
</script>
<script src="../Common/webgl-utils.js"></script>
<script src="../Common/initShaders.js"></script>
<script src="../Common/MV.js"></script>
<script src="triangle-shade.js"></script>
</head>
<body>
<canvas id="gl-canvas" width="640" height="480">
Your browser doesn't support HTML5!
</canvas>
</body>
</html>