-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest3.html
54 lines (47 loc) · 1.56 KB
/
test3.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
<!-- Licensed under a BSD license. See license.html for license -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<title>WebGL - Fundamentals</title>
<style>
html { height: 100%;}
body { margin: 0; width: 100%; height: 100%; }
canvas { margin: 0; width: 100%; height: 100%; }
</style>
</head>
<body>
<canvas id="c"></canvas>
</body>
</html>
<!--
for most samples webgl-utils only provides shader compiling/linking and
canvas resizing because why clutter the examples with code that's the same in every sample.
See http://webglfundamentals.org/webgl/lessons/webgl-boilerplate.html
and http://webglfundamentals.org/webgl/lessons/webgl-resizing-the-canvas.html
for webgl-utils, m3, m4, and webgl-lessons-ui.
-->
<script id="2d-vertex-shader" type="notjs">
attribute vec4 a_position;
attribute float particleIndex;
varying float vparticleIndex;
uniform float tmpParticleSize;
void main() {
vparticleIndex = particleIndex;
float value = (vparticleIndex + 1.0) / 5.0;
gl_PointSize = tmpParticleSize;//600.0;
gl_Position = vec4(0, 0, 0, 1);
}
</script>
<script id="2d-fragment-shader" type="notjs">
precision highp float;
varying float vparticleIndex;
void main() {
//gl_FragColor = vec4(0,0,0,1);
float value = (vparticleIndex + 1.0) / 5.0;
gl_FragColor = vec4(value, value, value, 1);
}
</script>
<script src="https://webglfundamentals.org/webgl/resources/webgl-utils.js"></script>
<<script src="src/js/webgltest.js" ></script>