-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
176 lines (156 loc) · 4.95 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebGL raytracer</title>
<meta charset="utf-8">
<meta property="og:url" content="https://oseiskar.github.io/webgl-raytracer" />
<meta property="og:title" content="WebGL Raytracer" />
<meta property="og:description" content="Run a GPU-powered bidirectional raytracer in the browser and experiment with different scenes and rendering options. Should work on Firefox and Chrome." />
<meta property="og:image" content="http://oseiskar.github.io/img/webgl-raytracer.png" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css?family=Crimson+Text" rel="stylesheet">
<style>
body {
margin: 0;
background: gray;
color: black;
font-family: 'Crimson Text', serif;
}
a {
color: black !important;
}
canvas {
border: 2px solid black;
box-sizing: content-box !important;
}
#shader-container {
display: flex;
justify-content: center;
}
.container {
margin-top: 5%;
margin-bottom: 2%;
}
.fullscreen canvas {
width: 100%;
height: 100%;
display: block;
border: 0 !important;
}
.fullscreen.expand-fullscreen {
width: 100vw;
height: 100vh;
display: block;
max-width: 100% !important;
border: 0 !important;
padding: 0 !important;
margin: 0 !important;
overflow: hidden;
}
.some-vpadding {
padding-top: 1em;
padding-bottom: 2em;
}
.gui-container {
display: flex;
justify-content: center;
}
#gui {
width: 100%;
max-width: 800px;
}
.gui select {
width: 100%;
color: black !important;
border: none;
background: #999 !important;
}
option {
/* white background flash bug in Chrome (at least on Linux) */
background: white !important;
background-color: white !important;
}
.gui button {
width: 100%;
}
.gui.col {
min-height: 2em;
display: flex;
align-items: center;
}
.gui.row {
padding: 3px;
}
.fullscreen.hide-fullscreen {
display: none !important;
}
.fullscreen.float-fullscreen {
position: absolute;
right: 0px;
top: 0px;
padding: 10px;
margin: 0 !important;
border: 0 !important;
width: 30%;
max-width: 500px;
display: block;
overflow: hidden;
}
.hidden {
display: none !important;
}
pre {
display: block;
color: black;
margin-top: 2em;
}
.invisible-element-trick {
position: absolute;
left: -9999px;
}
</style>
</head>
<body>
<div class="container catch-fullscreen expand-fullscreen">
<h1 class="catch-fullscreen hide-fullscreen">
<a href="https://github.com/oseiskar/webgl-raytracer">WebGL Raytracer</a>
</h1>
<div class="row catch-fullscreen expand-fullscreen">
<div class="col-md catch-fullscreen expand-fullscreen some-vpadding">
<div id="shader-container" class="catch-fullscreen expand-fullscreen">
</div>
</div>
<div class="gui-container col-md catch-fullscreen float-fullscreen some-vpadding">
<div id="gui">
</div>
</div>
</div>
<div id="shader-source-container" class="hidden catch-fullscreen hide-fullscreen some-vpadding">
<textarea id="copy-to-clipboard-area" class="invisible-element-trick">
</textarea>
<a href="#" id="save-image-as" class="invisible-element-trick"></a>
<h4>GLSL fragment shader source code</h4>
<pre id="shader-source">
</pre>
<h4>Data</h4>
<pre id="glsl-uniforms">
</pre>
<button id="copy-to-clipboard-button" class="btn" style="margin-right: 2em">Copy spec to clipboard</button>
<a href="https://github.com/oseiskar/glsl-bench"><small>what spec?</small></a>
</div>
<script src="https://unpkg.com/[email protected]/build/three.min.js"></script>
<script src="https://unpkg.com/[email protected]/examples/js/controls/OrbitControls.js"></script>
<script src="build/bundle.js"></script>
<script>
const twgl = require('twgl.js');
</script>
<script src="glsl-bench/glsl_bench.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mobile-detect/1.4.3/mobile-detect.min.js" crossorigin="anonymous"></script>
<script>
const isMobileBrowser = !!(new MobileDetect(window.navigator.userAgent).mobile());
require('app').start();
</script>
</body>
</html>