-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
178 lines (168 loc) · 6.37 KB
/
Copy pathindex.html
File metadata and controls
178 lines (168 loc) · 6.37 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="src/style.css" />
<title>WebGPU Erosion</title>
</head>
<body>
<main id="viewport">
<canvas id="viewport-canvas" width="800" height="600"></canvas>
</main>
<aside id="control-panel">
<header>
<h1>WebGPU Hydraulic Erosion</h1>
<p>
Based on a
<a href="https://inria.hal.science/inria-00402079/document"
>paper by Xing Mei, Philippe Decaudin and Bao-Gang Hu</a
>.
</p>
</header>
<fieldset>
<legend>visualization :</legend>
<div>
<input
type="radio"
name="visualization"
value="terrain"
id="terrain"
checked
/>
<label for="terrain">terrain</label>
</div>
<div hidden>
<input
type="radio"
name="visualization"
value="flow-x"
id="flow-x"
/>
<label for="flow-x">flow x</label>
</div>
<div hidden>
<input
type="radio"
name="visualization"
value="flow-y"
id="flow-y"
/>
<label for="flow-y">flow y</label>
</div>
<div hidden>
<input
type="radio"
name="visualization"
value="velocity-x"
id="velocity-x"
/>
<label for="velocity-x">velocity x</label>
</div>
<div hidden>
<input
type="radio"
name="visualization"
value="velocity-y"
id="velocity-y"
/>
<label for="velocity-y">velocity y</label>
</div>
<div>
<input
type="radio"
name="visualization"
value="sediment"
id="sediment"
/>
<label for="sediment">sediment</label>
</div>
</fieldset>
<fieldset>
<legend>controls :</legend>
<button id="start-stop-button">stop/resume</button>
<button id="reset-button">reset</button>
</fieldset>
<fieldset>
<legend>parameters :</legend>
<label hidden for="timestep-input">timestep</label>
<input
hidden
type="number"
id="timestep-input"
value="1"
step="0.1"
/>
<label for="rainfall-input">rainfall</label>
<input
type="number"
id="rainfall-input"
value="0.12"
step="0.01"
/>
<label hidden for="g-input">gravity</label>
<input
hidden
type="number"
id="g-input"
value="1.0"
step="0.1"
/>
<label for="kc-input">sediment capacity</label>
<input type="number" id="kc-input" value="1.2" step="0.1" />
<label for="ks-input">sediment dissolving</label>
<input type="number" id="ks-input" value="0.1" step="0.01" />
<label for="kd-input">sediment deposition</label>
<input type="number" id="kd-input" value="0.1" step="0.01" />
<label for="evaporation-input">evaporation</label>
<input
type="number"
id="evaporation-input"
value="0.05"
step="0.01"
/>
</fieldset>
<fieldset hidden>
<legend>individual steps</legend>
<button id="water-increment-button">water increment</button>
<button id="outflow-flux-button">outflow flux</button>
<button id="water-velocity-button">water / velocity</button>
<button id="erosion-deposition-button">
erosion / deposition
</button>
<button id="transportation-button">transportation</button>
<button id="evaporation-button">evaporation</button>
<button id="full-step-button">full step</button>
</fieldset>
<fieldset id="scale-fieldset">
<legend>scale</legend>
<p>note : settings in this category require a reset</p>
<div>
<label for="height-scale-input"
>virtual terrain height</label
>
<input
type="number"
id="height-scale-input"
value="200"
step="10"
/>
<p>unit is m</p>
</div>
<div>
<label for="resolution-select"
>virtual terrain resolution</label
>
<select name="resolution" id="resolution-select">
<option value="256">256</option>
<option value="512">512</option>
<option value="1024" selected>1024</option>
<option value="1024">2048</option>
</select>
<p>1 pixel = 1m²</p>
</div>
</fieldset>
</aside>
<script type="module" src="/src/main.ts"></script>
</body>
</html>