This repository was archived by the owner on Jan 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
68 lines (54 loc) · 1.39 KB
/
index.html
File metadata and controls
68 lines (54 loc) · 1.39 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Guten Tag</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body, html { height:100%; }
body {
margin:0;
}
canvas{
position:absolute;
}
</style>
<script id="shader-vs" type="x-webgl-shader/x-vertex">
uniform mat3 uTransformToClipSpace;
attribute vec2 aPosition;
attribute float aR;
attribute vec3 aColor;
varying vec3 vColor;
void main(void) {
vec2 p = aPosition;
vec2 pos = (uTransformToClipSpace * vec3(aPosition, 1.0)).xy;
float radius = aR;
vColor = aColor;
gl_Position = vec4(pos, 0.0, 1.0);
gl_PointSize = radius * 2.0;
}
</script>
<script id="shader-fs" type="x-webgl-shader/x-fragment">
varying mediump vec3 vColor;
void main(void) {
const lowp float ALPHA = 1.00;
lowp vec2 pos = gl_PointCoord - vec2(0.5, 0.5);
lowp float dist_squared = dot(pos, pos);
lowp float alpha;
if (dist_squared < 0.25) {
alpha = ALPHA;
} else {
alpha = 0.0;
}
gl_FragColor = vec4(vColor, alpha);
}
</script>
</head>
<body id="body" style = "margin:0 ;background: black">
<canvas id="cvs" style="height:33%"></canvas>
<canvas id="canvas"></canvas>
<script src="https://luksab.github.io/JSLib/JSLib.js"></script>
<script src="https://luksab.github.io/JSLib/JSColor.js"></script>
<script src="WebGlLED.js"></script>
</body>
</html>