-
Notifications
You must be signed in to change notification settings - Fork 0
/
airosol.html
54 lines (54 loc) · 1.55 KB
/
airosol.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Aerosol | JuanFuent.es</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<link rel="stylesheet" href="css/main.css">
<style>
button {
background: rgb(40, 0, 0);
left: 1em;
bottom: 1em;
transform: none;
}
</style>
</head>
<body>
<button id="clean-btn">Press any key to clean</button>
<script id="vertexShader" type="x-shader/x-vertex">
varying vec2 vUv;
void main() {
vUv = uv;
vec4 pos = modelViewMatrix * vec4( position, 1.0 );
gl_Position = projectionMatrix * pos;
}
</script>
<script id="fragmentShader" type="x-shader/x-fragment">
varying vec2 vUv;
uniform sampler2D uTexture;
uniform float uTime;
void main() {
float time = sin(uTime * 42.);
vec3 color = texture2D(uTexture, vUv).rgb;
vec3 iris = vec3(
abs(sin(vUv.x + time * color.r * 5.)),
abs(cos(vUv.y - time * color.g * 10.)),
abs(sin(vUv.x + time * color.b * 5.))
);
gl_FragColor = vec4((iris * color), 1.);
}
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.7.5/dat.gui.min.js"></script>
<script src="static/vendor.js"></script>
<script type="module">
import Airosol from "./js/airosol.js"
const AERO_IRIS = new Airosol()
const gui = new dat.GUI()
gui.add(AERO_IRIS.aerosol, 'radio', 10, 50).step(1)
gui.add(AERO_IRIS.aerosol, 'amplitude', 0, 4).step(.05)
gui.add(AERO_IRIS.aerosol, 'died_steps', 2, 30).step(1)
gui.add(AERO_IRIS.aerosol, 'total_psts', 2, 6).step(1)
</script>
</body>
</html>