cloud reflectance by the sun's angle

This commit is contained in:
connor committed 2026-10-18 15:52:27 -04:00
1 parent c7b890f3db
commit 79c54dcfe9
5 files changed
+220 -78

No files matched your search

+60 -27
View File
@@ -1257,13 +1257,13 @@ of 2001 July 29, with thermal infrared over the poles, 1 km per pixel, resized
to 16384 x 8192 like the Earth maps (`scripts/fetch-clouds.sh`). The same
clouds show whatever the date.
Each pixel's value is read as the cloud's reflectance there, from 0 for clear
sky to 1. Clouds absorb almost no visible light, so what a cloud does not
reflect it passes on: 1 minus its reflectance. A thick cloud is bright and
hides the ground. A thin one is dim and lets the ground show through. How
reflectance goes with a cloud's optical thickness tau (how many times light
would be scattered crossing it straight) is the two-stream result of Lacis and
Hansen (1974):
Each pixel's value is read as the cloud's diffuse reflectance there: what it
reflects of light arriving from every direction alike, from 0 for clear sky to 1.
Clouds absorb almost no visible light, so what a cloud does not reflect it passes
on. A thick cloud is bright and hides the ground. A thin one is dim and lets the
ground show through. The value gives the cloud's optical thickness tau (how many
times light would be scattered crossing it straight) by the two-stream result of
Lacis and Hansen (1974):
R = 0.13 tau / (1 + 0.13 tau)
@@ -1273,20 +1273,46 @@ forward scattering. So tau = 5 reflects 39 %, tau = 20 reflects 72 %, and tau =
of the area has more than 0.05. The map stores reflectance, so its mip levels
average reflectance, which keeps a far view of Earth as bright as a near one.
A cloud reflects more of a beam the more slanting it is: light entering at a low
angle scatters out of the top before it gets deep. A Monte Carlo of a cloud slab
(no absorption, the droplets' scattering as a Henyey-Greenstein function of g =
0.85, black below, 200,000 photons a case) gives:
| tau | Sun overhead | 60 degrees from it | 78 degrees | Diffuse (above) |
|---|---|---|---|---|
| 1 | 0.043 | 0.165 | 0.418 | 0.115 |
| 3 | 0.142 | 0.359 | 0.568 | 0.281 |
| 10 | 0.422 | 0.603 | 0.732 | 0.565 |
| 30 | 0.713 | 0.806 | 0.868 | 0.796 |
| 100 | 0.897 | 0.929 | 0.952 | 0.929 |
So the sunlight a cloud reflects, and the shadow it casts, come from tau and the
Sun's angle by the delta-Eddington method (Joseph, Wiscombe and Weinman 1976),
in closed form. It takes the forward peak of the droplets' scattering, a
fraction g^2 of it, as no scattering at all, and the rest as two streams of
light, up and down. It is within 0.08 of every case of the Monte Carlo, worst for
thin cloud under a low Sun, where the diffuse value is off by up to 0.30.
Averaged over the Sun's angles it is within 0.02 of the Monte Carlo's average,
as the diffuse value is. Sky light, which arrives from every direction, takes
the diffuse value.
For each pixel that sees the ground, the shader:
1. finds where the line of sight crosses the layer, and reads the cloud there.
In an oblique view that is not the cloud straight above the ground point,
so clouds show parallax against the ground;
2. finds where the sunlight reaching the ground point crossed the layer, and
dims the ground's sunlight and sky light by that cloud. That is the cloud's
dims the ground's sunlight by what that cloud passes on at the Sun's angle,
and its sky light by what it passes on of diffuse light. That is the cloud's
shadow, offset from the cloud away from the Sun: 5 km times the cotangent of
the Sun's elevation, 29 km with the Sun 10 degrees up;
3. adds the cloud's own light: sunlight and sky light at 5 km, which pass
through less air than at the ground, times the cloud's reflectance;
3. adds the cloud's own light: the sunlight at 5 km, which passes through less
air than at the ground, times the cloud's reflectance at the Sun's angle, and
the sky light there times its diffuse reflectance;
4. adds what is below the cloud, the ground and the air between it and the
layer, times 1 minus the cloud's reflectance. Then it applies the air above
the layer: its glow added, and its transmittance on what is under it.
layer, times what the cloud passes on at the line of sight's angle. Then it
applies the air above the layer: its glow added, and its transmittance on
what is under it.
So high clouds are less hazed than the ground, the way they look from orbit.
The ray's entry into the atmosphere is looked up once and shared by the cloud
@@ -1294,24 +1320,26 @@ and the ground below it.
The Earthshine pass samples the same layer, so a target over cloud receives
more light. A plate 700 km up facing straight down, the Sun overhead, under
clouds of reflectance 0.5 everywhere, receives 2.6, 2.4 and 2.1 times its
clouds of reflectance 0.5 everywhere, receives 2.0, 1.9 and 1.75 times its
cloud-free Earthshine in red, green and blue.
How bright Earth is as a whole tests the reading of the map's values as
reflectance. With clouds, rendered at phase angles from 0 to 180 degrees and
integrated over them, Earth reflects 0.27 to 0.29 of the sunlight in green
integrated over them, Earth reflects 0.26 to 0.28 of the sunlight in green
(the Bond albedo), from four sides in July. Without clouds it reflects 0.13 to
0.16. Measured, Earth's Bond albedo is about 0.30 (CERES, over the whole solar
spectrum). The geometric albedo, the full disk's brightness seen from the
Sun's direction, is 0.19 to 0.21 in green here, against 0.43 for the real
spectrum). With the diffuse reflectance alone in place of delta-Eddington it was
0.27 to 0.29. The geometric albedo, the full disk's brightness seen from the
Sun's direction, is 0.17 to 0.19 in green here, against 0.43 for the real
Earth, because clouds and the ocean send back toward the Sun more light than a
Lambertian surface does.
Tests (`tests/gpu/clouds.rs`), on the GPU and lavapipe:
- A uniform layer over gray ground, for four reflectances from clear to opaque,
against the atmosphere's tables in f64 at the cloud's height and the
ground's (within 3.3e-4).
- A uniform layer over gray ground, for four reflectances from clear to opaque
and the Sun 30 and 70 degrees from the zenith, against the atmosphere's tables
and delta-Eddington in f64 at the cloud's height and the ground's (within
3.3e-4).
- A clear map against no map. Lavapipe agrees to 2.4e-7. The RTX 3060 differs
by up to 6.7e-3 in 0.3 % of pixels, 1.8e-6 on average: its texture filtering
steps by 1/256 between texels, and a coordinate that differs in its last bit
@@ -1320,10 +1348,12 @@ Tests (`tests/gpu/clouds.rs`), on the GPU and lavapipe:
above: the cloud and its shadow 28.7 km to the west land within 0.41 and
0.12 px of where they project, 261 px apart.
- The Earthshine above, against the ratio for Earth seen straight down (within
8 %; less in blue, where more of the light from the slant views is the
10 %; 3 to 8 % less, most in blue, as the slant views around the nadir see the
clouds pass on less of what is below them, and more of their light is the
air's).
Unit tests in `clouds.rs` check the reflectance formula and the mip averaging.
Unit tests in `clouds.rs` check the reflectance formulas, delta-Eddington against
the Monte Carlo above, and the mip averaging.
The command-line tests check that a missing map names `scripts/fetch-clouds.sh`,
and that `[appearance] clouds = false` renders without one.
@@ -1332,16 +1362,19 @@ only once set, so frames without clouds cost what they did. With Earth filling
1920 x 1080 at camera C1, the bodies pass on the RTX 3060 goes from 2.4 to 3.1 ms
over mostly clear Egypt, and from 2.5 to 3.7 ms over the cloudy Pacific,
7.2 ms a frame end to end. On lavapipe, the Pacific view goes from 49 to 64 ms.
Earthshine: unchanged (0.045 ms).
Delta-Eddington's division and three exponentials per pixel add 0.03 ms to that
on the RTX 3060 and nothing measurable on lavapipe. Earthshine: unchanged
(0.045 ms).
Limitations:
- **One height**, and no thickness. Clouds stand neither above the limb nor
above one another, and cast no shadows on each other. Volumetric clouds are
planned for lighting L2.
- **Gray, Lambertian, and not absorbing.** Real clouds reflect more back toward
the Sun and forward along the light, and show a glory and a bright rim at the
terminator that a Lambertian layer does not.
- **Gray, and not absorbing.** The light a cloud reflects leaves it evenly in
every direction (Lambertian), though how much it reflects follows the Sun's
angle. Real clouds send more back toward the Sun and forward along the light,
and show a glory and bright rims at the terminator.
- **No light between the cloud and the ground**: the ground's light reflected
back down by the cloud's base is left out. It matters over snow and ice.
- **The sky light under a cloud** is dimmed by the cloud toward the Sun, not by
@@ -1395,8 +1428,8 @@ The mean reflectance is 0.247, against 0.207 for the static map. Fewer pixels ar
cloudy, 55 % against 65 % north of 60 S, but those that are are brighter.
**Checking it.** Earth rendered at phase angles from 0 to 180 degrees, as for the
static map, reflects 0.31 to 0.33 of the sunlight in green (Bond albedo) with the
day's clouds, against 0.27 to 0.29 with the static map and about 0.30 measured.
static map, reflects 0.30 to 0.32 of the sunlight in green (Bond albedo) with the
day's clouds, against 0.26 to 0.28 with the static map and about 0.30 measured.
Seen from 80,000 km over Africa, the day's clouds lie where MODIS's true-color
image of that day shows them: the storms over the North Atlantic, the band over
the Sahel, and the clouds over Europe. The Saharan dust in that image is aerosol,