-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
143 lines (138 loc) · 5.24 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/main.css" />
<title>Create a planetary atmosphere</title>
</head>
<body>
<div class="loading_screen" id="loading_screen">
<div class="loading_spinner"></div>
</div>
<noscript id="noscript">
Please enable JavaScript for the 3D visuals.
</noscript>
<canvas id="bg"></canvas>
<file id="frag" data="./atmo_shader_frag.glsl" type="text/plain"></file>
<file id="vert" data="./atmo_shader_vert.glsl" type="text/plain"></file>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/0.147.0/three.js"
integrity="sha512-yewcaF6iD3IU62N4N33Y8C7Zo3jx50MUaEMII/kQAdWnLdw4f3rab2Ay9Xp4O6waXDZhx7i/nvm+qGuJhXF+uw=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script> -->
<script type="importmap">
{
"imports": {
"three": "https://cdn.jsdelivr.net/npm/[email protected]/build/three.module.js"
}
}
</script>
<script type="module" src="./physics_utils.js"></script>
<script type="module" src="./main.js"></script>
<h1>Create a planetary atmosphere</h1>
<!-- <div id="fps">0</div> -->
<div id="main_page">
<div class="controls_frame" id="atmo_params">
<h2>Physical parameters</h2>
<div class="controls_scrollbox">
<div class="controls">
<div class="error_message_lmao"></div>
<div>
Planet radius (km)
<div class="help_display" id="planet_radius_display">6378</div>
<input type="number" min="100" max="10000" step="1" value="6378" id="planet_radius">
</div>
<div>
Planet mass (10<sup>20</sup>kg)
<div class="help_display" id="planet_mass_display">59700</div>
<input type="number" min="100" max="100000" value="59700" step="100" id="planet_mass">
</div>
<div>
Surface air density
<div class="help_display" id="surface_density_display">10</div>
<input type="range" min="1" max="20" step="1" value="10" class="slider" id="surface_density">
</div>
<div>
Temperature (K)
<div class="help_display" id="temperature_display">300</div>
<div class="help_display" id="temperature_advice">temperate</div>
<input type="range" min="200" max="750" step="10" value="300" class="slider" id="temperature">
</div>
<div>
Star temperature
<div>
<span class="help_display" id="star_temp_display">4000</span><span class="help_display">
K</span> <span id="star_temp_display_block">█</span>
</div>
<input type="range" min="1200" max="10000" step="50" value="5400" class="slider" id="star_temp">
</div>
</div>
</div>
</div>
<div class="controls_frame" id="render_params">
<h2>Rendering options</h2>
<div class="controls_scrollbox">
<div class="controls">
<div class="error_message_lmao"></div>
<div>
View path samples
<div class="help_display" id="view_path_samples_display">100</div>
<div class="help_display" id="view_path_samples_advice">decent</div>
<input type="range" min="5" max="1500" step="5" value="100" class="slider"
id="view_path_samples">
</div>
<div>
Light path samples
<div class="help_display" id="light_path_samples_display">5</div>
<input type="range" min="3" max="20" step="1" value="5" class="slider" id="light_path_samples">
</div>
<div>
Density-Opacity curve
<div class="help_display">Exponential base for density-to-opacity conversion</div>
<div class="help_display" id="opacity_curve_base_display">40</div>
<input type="range" min="2" max="200" step="1" value="40" class="slider"
id="opacity_curve_base">
</div>
<div>
Color scatter
<div class="help_display">Exponential base for red light scattering</div>
<div class="help_display" id="red_scatter_base_display">12.0</div>
<input type="range" min="1.01" max="20.0" step="0.01" value="12.0" class="slider"
id="red_scatter_base">
</div>
<div>
Atmosphere base color
<div class="help_display">
<span>RGB = (</span>
<span id="atmo_color_R_display">0.78</span>,
<span id="atmo_color_G_display">0.85</span>,
<span id="atmo_color_B_display">1</span>
<span>)</span>
</div>
<div>
<input type="range" min="0" max="1" step="0.01" value="0.78" class="color_slider"
id="atmo_color_R">
<input type="range" min="0" max="1" step="0.01" value="0.85" class="color_slider"
id="atmo_color_G">
<input type="range" min="0" max="1" step="0.01" value="1" class="color_slider"
id="atmo_color_B">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="info_pane">
<a href="https://www.github.com/michaeljfang/atmosphere-shader">HTML and GLSL source code</a>
<br>
<span class="small_text">
This site downloads the three.js library & addons from jsDelivr CDNs.<br>
Earth textures derived from a 2002 mosaic of Earth: <a class="link"
href="https://en.wikipedia.org/wiki/File:Blue_Marble_2002.png">WikiMedia page</a> /
<a
href="https://visibleearth.nasa.gov/images/57752/blue-marble-land-surface-shallow-water-and-shaded-topography">NASA
source</a>
</span>
</div>
</body>
</html>