Skip to content

3d clouds #409

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 57 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
30bbdc1
implement some ideas from Nubis
Jan 27, 2025
eb2a675
Merge branch 'raw-capture' into advanced_cloud_model
Jan 27, 2025
d30525f
wieghting clouds with simple 3d noise
Jan 27, 2025
8715b1b
Merge remote-tracking branch 'upstream/main' into advanced_cloud_model
Jan 27, 2025
91a4ad9
toggle between old and new cloud models
Jan 28, 2025
26e5b33
respect cloud model selection in cloud shadow calculation
Jan 28, 2025
a3bf631
set cloud rendering interval based on case distinction
Jan 29, 2025
a5e0c81
truly 3d clouds, no PBR yet
Jan 29, 2025
b1552e4
physically based clouds v1
Feb 3, 2025
2ffc68a
significantly increase cloud desity
Feb 3, 2025
4813626
adaptive sampling of more points when distance is very long
Feb 3, 2025
30299c9
layering high frequency noise with clouds
Feb 3, 2025
e8d5458
cirrus clouds
Feb 4, 2025
effa873
AltoCumulus at correct height
Feb 4, 2025
2595b6c
before adaptive sampling
Feb 4, 2025
40cf0dd
adaptive sampling looking good (except at horizon or very close inspe…
Feb 4, 2025
664213f
random distortion in cirrus clouds
Feb 6, 2025
be8f91d
simplified distorted cirrus clouds
Feb 13, 2025
1dc7509
fix glitch arising from intersection.x being > 0 when there was no in…
Feb 13, 2025
f09395c
noise generation on CPU proof of concept
Feb 19, 2025
88251d6
tune cpu noise and sampling to give results similar to shader noise f…
Feb 19, 2025
131d316
altocumulus based on cloud texture again
Feb 19, 2025
1daa084
secondary rays test
Feb 20, 2025
9a67787
fix artifact near horizon
Feb 20, 2025
da88b7f
proper blending of clouds and atmosphere. buggy
Feb 24, 2025
9707e8c
fix wrong distance bug
Feb 24, 2025
6d268df
layering bug fixes
Feb 25, 2025
9cfbfdd
compute inscattering over short segments through approximation
Feb 26, 2025
99ded98
interval length fixes
Mar 3, 2025
cbf76ac
more interval length fixes
Mar 3, 2025
e435dfa
track atmosphere inscattering, create stubs for skipping empty regions
Mar 4, 2025
2b8b728
implement some ideas from Nubis evolved. artifact-free clouds at some…
Mar 5, 2025
9bea482
better adaptive sampling
Mar 6, 2025
7ee89d3
artifact-free skipping of larger regions
Mar 12, 2025
2e3686f
higher resolution noise texture
Mar 12, 2025
47eb90a
Merge remote-tracking branch 'origin/main' into noise_texture
Mar 12, 2025
ff5e5b0
different cloud layering function. Do not take away as much from the …
Mar 12, 2025
8458100
secondary rays
Mar 12, 2025
e5ec2b4
adopt top and bottom type texture approach from nubis evolved
Mar 12, 2025
9a8ad8c
blending rules with fewer samples
Mar 13, 2025
43b2615
even nicer looking blending
Mar 13, 2025
3973ea6
somewhat convincing cloud tops at okayish performance
Mar 13, 2025
1c5ae43
get dimensional provile in one pass directly from texture, optimize s…
Apr 1, 2025
de41bc5
do not use high frequency noise in secondary rays
Apr 1, 2025
d9b20b6
blend high frequency cloud details with distance
Apr 1, 2025
c629d47
blue channel of cloud type texture for high frequency influence
Apr 1, 2025
c796753
30-60fps 🥳
Apr 1, 2025
717f304
cloud type texture and noises tuned for space views
Apr 2, 2025
9ccd744
naming change old clouds toggle to advanced clouds toggle. Remove unu…
Apr 2, 2025
e3b8566
rename cloudTop texture to cloudType and change setting.json template…
Apr 2, 2025
58a4838
add shader comments and high-quality phase function
Apr 8, 2025
e2a3c50
add comments to the main integration loop
Apr 8, 2025
bbd39a8
clean up interval length calculation
Apr 8, 2025
ba25c43
final clean-up
Apr 8, 2025
93d1787
Merge branch 'noise_texture' into 3d_clouds
Apr 8, 2025
ef5b438
remove debug printing and make default cloud model activation indepen…
Apr 14, 2025
6054600
advanced cloud model documentation
Apr 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@
[submodule "plugins/csp-atmospheres/bruneton-preprocessor/output"]
path = plugins/csp-atmospheres/bruneton-preprocessor/output
url = https://github.com/cosmoscout/atmosphere-data.git
[submodule "externals/TileableVolumeNoise"]
path = externals/TileableVolumeNoise
url = https://github.com/sebh/TileableVolumeNoise
1 change: 1 addition & 0 deletions config/base/scene/simple_desktop.json
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,7 @@
"Earth": {
"cloudTexture": "../share/resources/textures/earth-clouds.jpg",
"limbLuminanceTexture": "../share/resources/textures/earthLimbLuminance.tif",
"cloudTypeTexture": "../share/resources/textures/cloudTop.jpg",
"topAltitude": 80000,
"bottomAltitude": -100,
"model": "Bruneton",
Expand Down
1 change: 1 addition & 0 deletions config/base/scene/simple_hmd.json
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,7 @@
"atmospheres": {
"Earth": {
"cloudTexture": "../share/resources/textures/earth-clouds.jpg",
"cloudTypeTexture": "../share/resources/textures/cloudTop.jpg",
"topAltitude": 80000,
"bottomAltitude": -100,
"model": "Bruneton",
Expand Down
44 changes: 44 additions & 0 deletions docs/advanced_cloud_model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!--
SPDX-FileCopyrightText: German Aerospace Center (DLR) <[email protected]>
SPDX-License-Identifier: CC-BY-4.0
-->

<p align="center">
<img src ="img/banner-advanced-clouds.jpg" />
</p>

# Advanced Cloud model

The advanced cloud model is a new addition to the atmospheres plug-in drawing heavy inspiration from Andrew Schneider's talks about the Nubis cloud model in Decima Engine. There is one new type of texture that has to be provided in the config file, `cloudTypeTexture`.

<div style="display: flex; justify-content: space-around;">
<img src="img/cloudType.jpg" alt="cloud type texture">
<img src="img/cloudType_density_prior.jpg" alt="density prior">
<img src="img/cloudType_low_frequency_noise_strength.jpg" alt="low frequency noise influence">
<img src="img/cloudType_high_frequency_noise_strength.jpg" alt="high frequency noise influence">
</div>

The texture is sampled depending on cloud type (U) and height in the cloud layer (V). The cloud type by default is calculated from the conventional cloud texture (+ some 2D noise and scaling), but you could also easily modify the shader code to read the cloud type directly from some texture.

The channels of the texture represent
1. The base density of the cloud. Unlike in Andrew Schneider's work, a single texture has to suffice for this because the cloud bottoms aren't as relevant for this system's main use case, generating views from space. In the shader code, the cloud type is remapped so that all values greater than `CLOUD_COVER_MAX` get assigned the maximum cloud type. This helps produce nice clean cloud tops for very large cloud formations.
2. Influence strength of low-frequency noises.
3. High-frequency noise influence. Keep this low for cloud bottoms.

All channels can be fine-tuned for specific scenarios. Currently the system is configured for large scale cloud scapes seen from space by default.

All noises are subject to a LOD system so that high-frequency noises are only sampled when they need to be. If you are changing the noise blending, you might also consider changing the LOD interval constants.

## References
### talks by Andrew Schneider at the SIGGRAPH advances in real-time rendering workshop
[2015](https://advances.realtimerendering.com/s2015/The%20Real-time%20Volumetric%20Cloudscapes%20of%20Horizon%20-%20Zero%20Dawn%20-%20ARTR.pdf)

[2017](https://advances.realtimerendering.com/s2017/Nubis%20-%20Authoring%20Realtime%20Volumetric%20Cloudscapes%20with%20the%20Decima%20Engine%20-%20Final%20.pdf)

[2022](https://advances.realtimerendering.com/s2022/SIGGRAPH2022-Advances-NubisEvolved-NoVideos.pdf)

[2023](https://advances.realtimerendering.com/s2023/Nubis%20Cubed%20(Advances%202023).pdf)

### Phase function used

Jendersie, Johannes, and Eugene d'Eon. "An Approximate Mie Scattering Function for Fog and Cloud Rendering." ACM SIGGRAPH 2023 Talks. 2023. 1-2.
Binary file added docs/img/banner-advanced-clouds.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/cloudType.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/cloudType_density_prior.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions plugins/csp-atmospheres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ They are not physically based but provide some plausible results.
"topAltitude": 80000,
"bottomAltitude": 0,
"cloudTexture": "../share/resources/textures/earth-clouds.jpg",
"cloudTypeTexture": "../share/resources/textures/cloudTop.jpg",
"model": "CosmoScoutVR",
"modelSettings": {
"mieAnisotropy": 0.76,
Expand Down
10 changes: 10 additions & 0 deletions plugins/csp-atmospheres/gui/atmospheres_settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@
<span>Clouds</span>
</label>
</div>
<div class="col-8 offset-4">
<label class="checklabel">
<input
type="checkbox"
data-callback="atmosphere.setOldClouds"
/>
<i class="material-icons"></i>
<span>Advanced Clouds</span>
</label>
</div>
<div class="col-8 offset-4">
<label class="checklabel">
<input
Expand Down
Loading
Loading