-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
70 lines (58 loc) · 2.25 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
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<head>
<title>Cosmos</title>
<link href='http://fonts.googleapis.com/css?family=Rajdhani' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
<div id="container"></div>
<div id="controls"></div>
<div id="coords"></div>
<div id="buttons">
<div id="button-data"></div>
<div id="button-search"></div>
</div>
<div id="menu-data" class="menu"></div>
<div id="menu-search" class="menu"></div>
<!--<audio src="audio/01 - Cosmos Main Title.mp3" autoplay></audio>-->
<!-- SHADERS FOR LUM -->
<script type="x-shader/x-vertex" id="vertexshader">
attribute vec3 color;
attribute float luminosity;
varying vec3 vColor;
varying float vDist;
varying float vLum;
void main() {
vColor = color;
vec4 currpos = vec4( position, 1.0 );
vDist = distance(modelViewMatrix*currpos, vec4(0.0, 0.0, 0.0, 1.0)) / 30000.0;
vLum = luminosity / 70.0;
gl_PointSize = 1.0 + (10.0 * vLum / vDist);
gl_Position = projectionMatrix * modelViewMatrix * currpos;
}
</script>
<script type="x-shader/x-fragment" id="fragmentshader">
uniform float cutoff;
varying vec3 vColor;
varying float vDist;
varying float vLum;
void main() {
float radius = distance( vec2(0.5,0.5), gl_PointCoord );
if ( radius > 0.5 ) {
discard;
}
float intensity = 1.0 + vLum - vDist;
if( radius < cutoff){
gl_FragColor = vec4( vec3(1.0,1.0,1.0) * intensity, 1.0);
} else {
float alpha = 1.0 - min( (radius-cutoff)*(1.0/(0.5-cutoff)), 1.0);
gl_FragColor = vec4( vColor*intensity, alpha);
}
}
</script>
<script src="./bundle.js"></script>
</body>
</html>