-
Notifications
You must be signed in to change notification settings - Fork 4
/
particle-blending.html
64 lines (54 loc) · 1.47 KB
/
particle-blending.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Workshop</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
font-family: Monospace;
background-color: #000;
color: #000;
margin: 0px;
overflow: hidden;
}
#info {
color: #000;
position: absolute;
top: 10px;
width: 100%;
text-align: center;
z-index: 100;
display:block;
}
#info a, .button { color: #f00; font-weight: bold; text-decoration: underline; cursor: pointer }
</style>
</head>
<body>
<div id="viewport"></div>
<script src="js/three.min.r58.js"></script>
<script src="js/OrbitControls.js"></script>
<script src="js/particle-blending.js"></script>
</body>
</html>
<script type="x-shader/x-vertex" id="vertexshader">
attribute vec3 color;
attribute float size;
attribute float alpha;
varying vec3 vColor;
void main() {
vColor = color;
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );
gl_PointSize = 50.0;
gl_Position = projectionMatrix * mvPosition;
}
</script>
<script type="x-shader/x-fragment" id="fragmentshader">
uniform vec3 color;
uniform sampler2D texture;
varying vec3 vColor;
void main() {
gl_FragColor = vec4( vColor, 0.5 );
gl_FragColor = gl_FragColor * texture2D( texture, gl_PointCoord );
}
</script>