forked from s-macke/VoxelSpace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·216 lines (196 loc) · 8.13 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
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
<!DOCTYPE html>
<html>
<head>
<title>Voxel Space project demonstration</title>
<meta charset="UTF-8">
<meta name="description" content="Demonstration of the Voxel Space technique">
<meta name="keywords" content="Voxel, VoxelSpace, Voxel Space, Comanche, landscape, rendering">
<style>
html, body {margin: 0; height: 100%; overflow: hidden}
canvas #firstperson { width: 100%; height: 100%; }
a { color: white; }
#info {
position: absolute;
bottom: 0px;
padding: 5px;
z-index:2;
color: white;
font-family: "Arial", Times, serif;
font-size: 100%;
}
#controls {
position: absolute;
bottom: 0px;
padding: 5px;
width: fit-content;
z-index:2;
color: black;
font-family: "Arial", Times, serif;
font-size: 100%;
}
#instructions {
position: absolute;
top: 0px;
width: 100%;
padding: 0px;
margin: 0px;
z-index:2;
color: black;
font-family: "Arial", Times, serif;
font-size: 100%;
}
#instructions p {padding: 0; margin: 0;}
#fps {
float: right;
position: absolute;
top: 0px;
right: 10px;
z-index:100;
padding: 5px;
color: black;
font-family: "Arial", Times, serif;
font-size: 100%;
}
#renderer
{
position: absolute;
top: 0px;
right: 0px;
padding: 0px;
margin: 0px;
z-index:2;
color: black;
font-family: "Arial", Times, serif;
font-size: 100%;
}
[data-tooltip]
{
color: black;
font-size: 100%;
width: fit-content;
}
[data-tooltip]::before
{
position : absolute;
content : attr(data-tooltip);
opacity : 0;
}
[data-tooltip]:hover::before
{
opacity : 1;
font-size: 70%;
background-color: yellow;
}
[data-tooltip]:not([data-tooltip-persistent])::before
{
pointer-events: none;
}
div.control
{
background-color: gray;
width: fit-content;
overflow:hidden;
}
*
{
user-select: none
}
label
{
display: block;
padding-bottom: 0.7em;
}
</style>
</head>
<body scroll="no">
<canvas id="firstperson" width="64" height="64" style="width: 640px; height: 640px; image-rendering: pixelated; margin: 0; padding: 0; display: block; z-index: 0;">Your browser does not support the canvas element.</canvas>
<div id="top" style="position: absolute; display: block; bottom: 0px; right: 0px; z-index: 1; opacity: 1.0; visibility: hidden;" >
<canvas id="map" width="1024" height="1024" style="width: 1024px; height: 1024px; margin: 0; padding: 0; z-index: 9; display: block; position: absolute; bottom: 0px; right: 0px; image-rendering: pixelated;"></canvas>
<canvas id="samples" width="1024" height="1024" style="width: 1024px; height: 1024px; margin: 0; padding: 0; z-index: 10; display: block; position: absolute; bottom: 0px; right: 0px; image-rendering: pixelated;"></canvas>
<div style="position: absolute;bottom: 0px; right: 0px; z-index: 13;">
<input type="range" id="mapOpacity" min="0.0" max="1.0" step="0.1" style="display: inline; position: absolute; bottom: 0px; right: 20px; ">
<input type="checkbox" id="toggleMap" name="toggleMap" style="display: inline; position: absolute; bottom: 0px; right: 0px; ">
<input type="checkbox" id="toggleRenderer" name="toggleRenderer" style="display: inline; position: absolute; bottom: 0px; right: 40px; ">
</div>
</div>
<div id="instructions">
<p>Use WSAD to move along the plane. R & F move up and down. Q & E rotate the camera. Hover over sliders for tooltips explaining purpose. Resizing browser viewport not supported! (set to 100%)</p>
</div>
<div id="info">
<select name="Mapselector" size="1" onchange="LoadMap(this.value);" value="C1W;D1">
<option value="C1W;D1">Map C1W</option>
<option value="C2W;D2">Map C2W</option>
<option value="C3;D3">Map C3</option>
<option value="C4;D4">Map C4</option>
<option value="C5W;D5">Map C5W</option>
<option value="C6W;D6">Map C6W</option>
<option value="C7W;D7">Map C7W</option>
<option value="C8;D6">Map C8</option>
<option value="C9W;D9">Map C9W</option>
<option value="C10W;D10">Map C10W</option>
<option value="C11W;D11">Map C11W</option>
<option value="C12W;D11">Map C12W</option>
<option value="C13;D13">Map C13</option>
<option value="C14;D14">Map C14</option>
<option value="C14W;D14">Map C14W</option>
<option value="C15;D15">Map C15</option>
<option value="C16W;D16">Map C16W</option>
<option value="C17W;D17">Map C17W</option>
<option value="C18W;D18">Map C18W</option>
<option value="C19W;D19">Map C19W</option>
<option value="C20W;D20">Map C20W</option>
<option value="C21;D21">Map C21</option>
<option value="C22W;D22">Map C22W</option>
<option value="C23W;D21">Map C23W</option>
<option value="C24W;D24">Map C24W</option>
<option value="C25W;D25">Map C25W</option>
<option value="C26W;D18">Map C26W</option>
<option value="C27W;D15">Map C27W</option>
<option value="C28W;D25">Map C28W</option>
<option value="C29W;D16">Map C29W</option>
</select>
</div>
<div id="controls">
<div class="control" >
<label for="nearWidth" data-tooltip="camera near plane width -- adjusts lateral field of view">nearWidth</label><input id="nearWidth" type="range" min="0.1" max="12.0" value="1.0" step="0.01">
</div>
<div class="control" >
<label for="zNear" data-tooltip="camera near cutoff distance">zNear</label><input id="zNear" type="range" min="1" max="1000"value="300" step="1">
</div>
<div class="control" >
<label for="zFar" data-tooltip="camera far cutoff distance">zFar</label><input id="zFar" type="range" min="100" max="10000"value="10000" step="1">
</div>
<div class="control">
<label for="height" data-tooltip="quickly adjust camera height">height</label><input id="height" type="range" min="0" max="1000" step="1">
</div>
<div class="control" >
<label for="columnscale" data-tooltip="scales terrain heightmap vertically">columnscale</label><input id="columnscale" type="range" min="1" max="10" value="1" step="0.01">
</div>
<div class="control" >
<label for="rayStepAccl" data-tooltip="the rate at which the raystep increases, higher values run faster">rayStepAccl</label><input id="rayStepAccl" type="range" min="0.001" max="1.0" value="0.01" step="0.001">
</div>
<!-- Just hide these for now so we needn't unbind them in the input class. -->
<div class="control"
style="visibility: hidden; display: none;" disabled="disabled">
<label for="heading" data-tooltip="near camera cutoff distance">heading</label><input id="heading" type="range" min="0.000000" max="6.2831853071" step="0.000001">
</div>
<div class="control"
style="visibility: hidden; display: none;" disabled="disabled">
<label for="pitch" data-tooltip="near camera cutoff distance">pitch</label><input id="pitch" type="range" min="-1.57" max="1.57" value="0.0" step="0.01">
</div>
<div class="control"
sstyle="visibility: hidden; display: none;" disabled="disabled">
<label for="horizon" data-tooltip="near camera cutoff distance">horizon</label><input id="horizon" type="range" min="0" max="1.0" value="0.5" step="0.01">
</div>
</div>
<select id="renderer">
<option value="0" selected>Novalogic (forward raymarch, non-linear sampling)</option>
<option value="1" >Solid F2B (forward raymarch)</option>
<option value="2" >Surface B2F (backward raymarch, draw upper surfaces only)</option>
<option value="3" >Overhang B2F (backward raymarch, slow! allows overhangs)</option>
<option value="4" >Radar view (adjust height slider till looks solid)</option>
</select>
<!-- <div id="fps" style="position: absolute; display: block; bottom: 0px; right: 0px;> -->
<!-- </div> -->
<script type="module" src="js/index.js"></script>
</body>