-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
160 lines (131 loc) · 4.43 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<html>
<head>
<meta charset="UTF-8">
<script src="js/functions.js"></script>
<title>Saturn | Adel Massimo Ramadan</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<audio src="music/interstellar.m4a" autoplay>
<p>If you are reading this, it is because your browser does not support the audio element. </p>
</audio>
<div class="selector" id="statsDiv">
<h4 id="cameraPos">camera Position:</h4>
<h4 id="particlesInfo">Particles per ring: </h4>
<hr>
particles<input oninput="selectParticles()" id="particlesSelector" type="range" value="100"><br>
speed<input oninput="selectSpeed()" id="speedSelector" type="range" value="20"><br>
bkg-tone<input oninput="selectBg()" id="bgSelector" type="range" value="100"><hr>
<button onclick="hidePlane()"> Plane </button>
<button onclick="hideAxis()"> Axis </button>
<button onclick="changeBackground()"> bkg </button>
<button onclick="changeShadow()"> shadow-type </button>
</div>
<body id="body" onload="init()">
<script type="x-shader/x-vertex" id="vertexShaderSaturn">
uniform float delta;
uniform float radius;
uniform float time;
uniform sampler2D texture;
varying vec2 vUv;
varying vec4 currentPostion;
void main()
{
vUv = uv;
vec3 newPosition = position;
gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0);
currentPostion = projectionMatrix * modelMatrix * vec4(newPosition, 1.0);
}
</script>
<script type="x-shader/x-fragment" id="fragmentShaderSaturn">
uniform sampler2D texture;
varying vec2 vUv;
varying vec4 currentPostion;
void main() {
vec4 baseColor = texture2D( texture, vUv.xy );
vec4 theColor = baseColor ;
theColor.a = 1.0;
if(currentPostion.z > 0.0){
theColor.x -= currentPostion.z/80.0;
theColor.y -= currentPostion.z/80.0;
theColor.z -= currentPostion.z/80.0;
}
gl_FragColor = theColor;
}
</script>
<script type="x-shader/x-vertex" id="vertexShaderDEBRIS">
attribute float base_angle;
attribute float offsetX;
attribute float offsetZ;
uniform vec3 stretch;
uniform float time;
varying vec4 vUv;
varying vec2 offset;
void main()
{
vec3 p = position;
offset = vec2(offsetX, offsetZ);
p.x = (stretch.x + offsetX)*cos( base_angle + time );
p.z = (stretch.z + offsetZ)*sin( base_angle + time );
p.y += (stretch.y + offsetX/10.0)*cos( base_angle + time );
gl_Position = projectionMatrix * modelViewMatrix * vec4(p, 1.0);
vUv = projectionMatrix * vec4(p, 1.0);
gl_PointSize = 1.0;
}
</script>
<script type="x-shader/x-fragment" id="fragmentShaderDEBRIS">
varying vec4 vUv;
varying vec2 offset;
uniform float shadowType;
void main() {
if( abs(offset.x) >= 30.0 || abs(offset.y) >= 10.0)
gl_FragColor = vec4(0.7, 0.7, 0.65, 0.90);
else
gl_FragColor = vec4(0.58, 0.49, 0.45, 0.90);
if((shadowType == 0.0 && vUv.z > 0.0) || (shadowType == 1.0 && vUv.z > 0.0 && abs(vUv.x) < 64.0))
gl_FragColor = gl_FragColor - vec4(vUv.zzz*0.0076, 0.0);
}
</script>
<script type="x-shader/x-vertex" id="vertexShaderTITANO">
uniform float delta;
uniform float radius;
uniform float time;
varying vec4 vUv;
void main()
{
vec3 p = position;
p.x += (time*0.03+120.0)*cos(time);
p.z += (time*0.03+120.0)*sin(time);
p.y += 100.0;
gl_Position = projectionMatrix * modelViewMatrix * vec4(p, 1.0);
vUv = vec4(p, 1.0);
}
</script>
<script type="x-shader/x-fragment" id="fragmentShaderTITANO">
uniform sampler2D texture;
uniform vec2 tile;
varying vec4 vUv;
void main() {
float R = 0.913 + (cos(vUv.y/10.0))/6.0;
float G = 0.78 + (cos(vUv.y/10.0))/6.0;
float B = 0.38 + (cos(vUv.y/10.0))/6.0;
if(vUv.z > 0.0)
gl_FragColor = vec4(R, G, B, 1.0);
else
gl_FragColor = vec4(R+vUv.z*0.05, G+vUv.z*0.05, B+vUv.z*0.05, 1.0);
}
</script>
<script src="js/three.js"></script>
<script src="js/libs/stats.min.js"></script>
<script src="js/OrbitControls.js"></script>
<script src="js/infos.js"></script>
<script src="js/functions.js"></script>
<script src="js/main.js"></script>
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript">
$( function() {
$( "#statsDiv" ).draggable();
} );
</script>
</body>
</html>