-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
491 lines (473 loc) · 19 KB
/
Copy pathindex.html
File metadata and controls
491 lines (473 loc) · 19 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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover"
/>
<meta name="theme-color" content="#0a0e06" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="description" content="Voxel Space" />
<meta name="author" content="Norbert Varga" />
<meta
name="keywords"
content="Voxel, VoxelSpace, Voxel Space, Comanche, landscape, rendering"
/>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=VT323&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="styles/styles.css" />
<script type="module" src="scripts/main.js" defer></script>
<title>Voxel Space</title>
<link rel="icon" type="image/x-icon" href="favicon.png" />
<style>
.offline-screen[hidden] {
display: none !important;
}
.offline-screen {
position: fixed;
inset: 0;
z-index: 10000;
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
background: #0a0e06;
color: #e8ecc8;
font-family: "Share Tech Mono", "Lucida Console", monospace;
}
</style>
</head>
<body class="chrome-on menu-closed radar-open cam-fly">
<header class="hud-top" aria-label="Status">
<div class="hud-brand">
<span class="hud-brand-mark" aria-hidden="true"></span>
<span class="hud-brand-name">Voxel Space</span>
</div>
<div class="hud-status">
<span class="hud-chip" id="id_hud_map">----</span>
<span class="hud-chip hud-chip--cyan" id="id_hud_algorithm">----</span>
<span class="hud-chip" id="id_hud_backend">----</span>
<span class="hud-chip hud-chip--green" id="id_hud_camera">----</span>
<span class="hud-chip" id="id_hud_quality">----</span>
<span class="hud-chip hud-chip--amber" id="id_hud_debug">Color</span>
</div>
<div class="hud-top-right">
<div id="id_fps" class="hud-fps" aria-live="polite"></div>
<button type="button" id="id_menu_toggle" class="hud-btn" aria-expanded="false" aria-controls="id_info">
Menu
</button>
<button type="button" id="id_hud_toggle" class="hud-btn" aria-expanded="true" aria-keyshortcuts="H">
Close
</button>
</div>
</header>
<div id="id_viewport" class="viewport">
<canvas id="id_fullscreen_canvas" width="800" height="400">
Your browser does not support the canvas element.
</canvas>
<aside id="id_radar" class="hud-radar" aria-label="Radar">
<canvas id="id_radar_canvas" width="256" height="256"></canvas>
</aside>
<button type="button" id="id_radar_show" class="hud-radar-tab" hidden aria-keyshortcuts="K">Radar</button>
<aside id="id_debug_legend" class="hud-legend" hidden>
<h2 class="hud-legend-title" id="id_debug_legend_title">Height</h2>
<div class="hud-legend-bar" id="id_debug_legend_bar" data-ramp="gray"></div>
<div class="hud-legend-ends">
<span id="id_debug_legend_low">0</span>
<span id="id_debug_legend_high">255</span>
</div>
<p class="hud-legend-caption" id="id_debug_legend_caption"></p>
<p class="hud-legend-miss">
<span class="hud-legend-swatch" aria-hidden="true"></span>
<span id="id_debug_legend_miss_label">Sky / miss</span>
</p>
</aside>
<div id="id_hud_backdrop" class="hud-backdrop" hidden></div>
<div class="hud-menu-dock">
<button
type="button"
id="id_menu_handle"
class="hud-menu-handle"
aria-label="Toggle menu"
aria-controls="id_info"
aria-expanded="false"
>
<span class="hud-menu-handle-grip" aria-hidden="true"></span>
</button>
<aside id="id_info" class="hud-panel" aria-label="Command panel">
<div class="hud-panel-scroll">
<section class="hud-section">
<h2 class="hud-section-title"><span>01</span> Mission</h2>
<div class="control" data-tip="Height and color maps from Comanche missions.">
<div class="control-head">
<label for="id_mapselector">Map</label>
</div>
<select id="id_mapselector" name="MapSelector" autocomplete="off" aria-keyshortcuts="M">
<option value="">Please select map</option>
</select>
</div>
</section>
<section class="hud-section">
<h2 class="hud-section-title"><span>02</span> Engine</h2>
<div class="control-grid">
<div class="control" data-tip="Classic: column voxel space. Panorama: 360° equirect. Cubemap: 6-face environment, cached like panorama.">
<div class="control-head">
<label for="id_algorithmselector">Algorithm</label>
</div>
<select
id="id_algorithmselector"
name="AlgorithmSelector"
autocomplete="off"
aria-keyshortcuts="L"
>
<option value="">Please select algorithm</option>
</select>
</div>
<div
class="control"
data-tip="Where pixels are produced. CPU · JS and CPU · WASM share the 2D canvas. GPU · WebGPU swaps to a WebGPU swapchain. Threads stay off on WebGPU."
>
<div class="control-head">
<label for="id_backendselector">Runtime</label>
</div>
<select
id="id_backendselector"
title="BackendSelector"
name="BackendSelector"
autocomplete="off"
aria-keyshortcuts="B"
>
<option value="">Please select runtime</option>
</select>
</div>
<div class="control" data-tip="Low to Very-high on any engine. Ultra is desktop WebGPU only: finer march and a larger panorama.">
<div class="control-head">
<label for="id_quality">Quality</label>
</div>
<select id="id_quality" name="quality" autocomplete="off" aria-keyshortcuts="1 2 3 4 5"></select>
</div>
<div
class="control"
data-tip="Fly: free flight. Orbital: circle the map center."
>
<div class="control-head">
<label for="id_cameraselector">Camera</label>
</div>
<select
id="id_cameraselector"
name="CameraSelector"
autocomplete="off"
aria-keyshortcuts="C"
>
<option value="">Please select mode</option>
</select>
</div>
</div>
</section>
<section class="hud-section">
<h2 class="hud-section-title"><span>03</span> View</h2>
<div class="control" data-tip="How far terrain is drawn (far clip).">
<div class="control-head">
<label for="id_render_distance">Distance</label>
<span class="control-value" data-for="id_render_distance"></span>
</div>
<input id="id_render_distance" type="range" autocomplete="off" aria-keyshortcuts="I Shift+I" />
</div>
<div
class="control"
data-tip="Where fog starts and where it saturates. The right end of the track is the current Distance. If the upper thumb is below Distance, terrain is only marched to that upper bound; Distance itself stays put."
>
<div class="control-head">
<label id="id_fog_range_label">Fog range</label>
<span class="control-value" data-for="id_fog_range"></span>
</div>
<div
class="range-dual"
id="id_fog_range"
role="group"
aria-labelledby="id_fog_range_label"
>
<div class="range-dual-rail" aria-hidden="true"></div>
<div class="range-dual-fill" aria-hidden="true"></div>
<button
type="button"
class="range-dual-thumb"
data-thumb="start"
id="id_fog_start"
aria-label="Fog start"
></button>
<button
type="button"
class="range-dual-thumb"
data-thumb="end"
id="id_fog_end"
aria-label="Fog end"
></button>
</div>
</div>
<div
class="control"
data-tip="How far height interp and color filter apply, as clip-plane distance (same units as fog / Distance). Screen corners stay on that plane; bilinear is not computed past it."
>
<div class="control-head">
<label for="id_filter_distance">Filter range</label>
<span class="control-value" data-for="id_filter_distance"></span>
</div>
<input id="id_filter_distance" type="range" autocomplete="off" />
</div>
<div class="control" data-tip="Ray step size. Lower is denser and slower.">
<div class="control-head">
<label for="id_delta_z">Delta Z</label>
<span class="control-value" data-for="id_delta_z"></span>
</div>
<input id="id_delta_z" type="range" autocomplete="off" aria-keyshortcuts="Z Shift+Z" />
</div>
<div class="control" data-tip="Horizontal field of view in degrees.">
<div class="control-head">
<label for="id_fov">FOV</label>
<span class="control-value" data-for="id_fov"></span>
</div>
<input id="id_fov" type="range" autocomplete="off" aria-keyshortcuts="O Shift+O" />
</div>
<div class="control" data-tip="Internal resolution. Set automatically by quality.">
<div class="control-head">
<label for="id_render_scale">Scale</label>
<span class="control-value" data-for="id_render_scale"></span>
</div>
<input id="id_render_scale" type="range" disabled autocomplete="off" />
</div>
</section>
<section class="hud-section">
<h2 class="hud-section-title"><span>04</span> Debug</h2>
<div
class="control"
data-tip="Color is the production picture. Height / Depth / Iterations recolor the camera view and the env atlas. A floating key next to the radar explains the scale."
>
<div class="control-head">
<label for="id_debugview">Debug view</label>
</div>
<select id="id_debugview" name="DebugView" autocomplete="off" aria-keyshortcuts="V">
<option value="">Please select debug view</option>
</select>
</div>
<div class="flag-grid">
<label
class="check"
for="id_debug_overlay"
data-tip="Unwrapped panorama or cubemap atlas. Uses the same debug view as the 3D picture. Hidden on classic."
>
<input
id="id_debug_overlay"
name="debugoverlay"
type="checkbox"
autocomplete="off"
aria-keyshortcuts="N"
/>
<span class="check-box" aria-hidden="true"></span>
Env atlas
</label>
</div>
</section>
<section class="hud-section">
<h2 class="hud-section-title"><span>05</span> Flags</h2>
<div class="flag-grid">
<label class="check" for="id_apply_fog" data-tip="Fade distant terrain into the sky. Start and end distances come from Fog range.">
<input
id="id_apply_fog"
name="applyfog"
type="checkbox"
autocomplete="off"
aria-keyshortcuts="G"
/>
<span class="check-box" aria-hidden="true"></span>
Fog
</label>
<label class="check" for="id_repeat" data-tip="Tile the map so the world wraps.">
<input id="id_repeat" name="repeat" type="checkbox" autocomplete="off" aria-keyshortcuts="P" />
<span class="check-box" aria-hidden="true"></span>
Repeat
</label>
<label
class="check"
for="id_interpolate_height"
data-tip="Bilinear height sampling. Off uses nearest texels."
>
<input
id="id_interpolate_height"
name="interpolateheight"
type="checkbox"
autocomplete="off"
/>
<span class="check-box" aria-hidden="true"></span>
Height interp
</label>
<label
class="check"
for="id_filter_color"
data-tip="World-space bilinear blend on the color map. Same 4 samples as the old box filter, but interpolates by position so texel edges fade instead of jumping."
>
<input id="id_filter_color" name="filtercolor" type="checkbox" autocomplete="off" />
<span class="check-box" aria-hidden="true"></span>
Color filter
</label>
<label
class="check"
for="id_multithread"
data-tip="Split rendering across worker threads."
>
<input
id="id_multithread"
name="multithread"
type="checkbox"
autocomplete="off"
aria-keyshortcuts="T"
/>
<span class="check-box" aria-hidden="true"></span>
Threads
</label>
</div>
</section>
<section class="hud-section hud-section--keys">
<h2 class="hud-section-title"><span>06</span> Input</h2>
<dl class="key-legend">
<div><dt>WASD</dt><dd>Move / strafe</dd></div>
<div><dt>Shift</dt><dd>Faster</dd></div>
<div><dt>Click</dt><dd>Mouse look</dd></div>
<div><dt>Arrows</dt><dd>Look</dd></div>
<div><dt>R F</dt><dd>Up / down</dd></div>
<div><dt>Space Ctrl</dt><dd>Up / down</dd></div>
<div class="pano-only"><dt>Q E</dt><dd>Roll</dd></div>
<div><dt>M</dt><dd>Cycle map</dd></div>
<div><dt>L</dt><dd>Cycle algorithm</dd></div>
<div><dt>B</dt><dd>Cycle runtime</dd></div>
<div><dt>1-5</dt><dd>Quality</dd></div>
<div><dt>C</dt><dd>Cycle camera</dd></div>
<div><dt>I Shift+I</dt><dd>Distance</dd></div>
<div><dt>Z Shift+Z</dt><dd>Delta Z</dd></div>
<div><dt>O Shift+O</dt><dd>FOV</dd></div>
<div><dt>V</dt><dd>Cycle debug view</dd></div>
<div class="pano-only"><dt>N</dt><dd>Toggle env atlas</dd></div>
<div><dt>G</dt><dd>Toggle fog</dd></div>
<div><dt>P</dt><dd>Toggle repeat</dd></div>
<div><dt>T</dt><dd>Toggle threads</dd></div>
<div><dt>H</dt><dd>Toggle HUD</dd></div>
<div><dt>K</dt><dd>Toggle radar</dd></div>
<div><dt>Esc</dt><dd>Close menu</dd></div>
</dl>
</section>
<section class="hud-section hud-section--touch">
<h2 class="hud-section-title"><span>06</span> Touch</h2>
<dl class="key-legend">
<div class="fly-only"><dt>L Stick</dt><dd>Move / strafe</dd></div>
<div class="orbit-only"><dt>L Stick</dt><dd>Zoom</dd></div>
<div class="fly-only"><dt>R Stick</dt><dd>Look</dd></div>
<div class="orbit-only"><dt>R Stick</dt><dd>Orbit</dd></div>
<div class="fly-only"><dt>Up Down</dt><dd>Altitude</dd></div>
<div class="pano-only fly-only"><dt>Roll</dt><dd>Bank left / right</dd></div>
<div><dt>Radar</dt><dd>Tap map to hide</dd></div>
<div><dt>Handle</dt><dd>Open / close menu</dd></div>
</dl>
</section>
<section class="hud-section hud-section--link">
<h2 class="hud-section-title"><span>07</span> Link</h2>
<a class="hud-link" href="https://github.com/varganorbert222/VoxelSpace"
>Github project</a
>
</section>
</div>
<div class="hud-panel-footer">
<button type="button" class="hud-done" id="id_hud_done">Done</button>
</div>
</aside>
</div>
<p class="hud-hint" id="id_hud_hint">H · Toggle HUD</p>
<div id="id_touch_controls">
<div class="touch-cluster touch-cluster--left">
<div id="id_stick_move" class="stick fly-only" aria-label="Move">
<div class="stick-knob"></div>
</div>
<div id="id_stick_zoom" class="stick stick--zoom orbit-only" aria-label="Zoom">
<div class="stick-knob"></div>
</div>
<div id="id_touch_alt" class="touch-btns fly-only">
<button type="button" id="id_btn_up">Up</button>
<button type="button" id="id_btn_down">Down</button>
</div>
</div>
<div class="touch-cluster touch-cluster--right">
<div id="id_touch_roll" class="touch-btns pano-only fly-only">
<button type="button" id="id_btn_roll_left">L</button>
<button type="button" id="id_btn_roll_right">R</button>
</div>
<div id="id_stick_look" class="stick" aria-label="Look">
<div class="stick-knob"></div>
</div>
</div>
</div>
</div>
<div id="id_offline" class="offline-screen" hidden>
<div class="offline-card">
<p class="offline-kicker">00 Status</p>
<h1 class="offline-title">No connection</h1>
<p class="offline-copy">
Waiting for the network. This page will reload when you are back
online.
</p>
<p class="offline-pulse" id="id_offline_status">Reconnecting…</p>
</div>
</div>
<script>
(function () {
var overlay = document.getElementById("id_offline");
var status = document.getElementById("id_offline_status");
var timer = 0;
var probing = false;
var down = false;
var POLL_MS = 2000;
function show() {
down = true;
overlay.hidden = false;
document.documentElement.classList.add("is-offline");
if (!timer) {
timer = window.setInterval(probe, POLL_MS);
}
probe();
}
function probe() {
if (probing) {
return;
}
probing = true;
if (status) {
status.textContent = "Reconnecting…";
}
fetch("data/config.json?n=" + Date.now(), { cache: "no-store" })
.then(function (res) {
probing = false;
if (down && navigator.onLine && res && res.ok) {
window.location.reload();
}
})
.catch(function () {
probing = false;
if (!down) {
show();
}
});
}
window.addEventListener("offline", show);
window.addEventListener("online", probe);
if (!navigator.onLine) {
show();
}
})();
</script>
</body>
</html>