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
//! The CPU side of the weathered shading: what is computed once per frame and handed to the
//! shaders in `ElementsGlobals`. The per-fragment functions are in `surface_cover.wesl` and
//! transliterated in `mirror.rs` for the tests.
use crateWeather;
/// Liquid precipitation at which the ripple and streak intensity reaches 1, mm/h: the rate at
/// which the rain particle count saturates (`precipitation/model.rs`, `min(1, R / 20)`).
pub const FULL_RAIN_MM_H: f32 = 20.0;
/// Lagarde (2013), "Water drop 2b": the four ripple layers' clock multipliers and offsets, and
/// the 1.6 that turns the product into a period of 0.625 s.
pub const RIPPLE_TIME_MUL: = ;
pub const RIPPLE_TIME_ADD: = ;
pub const RIPPLE_RATE: f64 = 1.6;
/// The streak phase wraps here, s. The streak noise drifts 0.5 lattice units per second and its
/// lattice repeats every 4096 units (`noise.wesl`), so 8192 s is exactly one lattice period and
/// the wrap is invisible.
pub const STREAK_WRAP_S: f64 = 8192.0;
/// Rain intensity `f = min(1, R_liquid / 20)`, 0 when only snow falls.
pub
/// Phase of the four ripple layers at `seconds` of the virtual clock:
/// `frac((t · TimeMul_k + TimeAdd_k) · 1.6)`, in f64 so it stays continuous however long the
/// game runs (a wrapped f32 clock jumps, because the multipliers are not integers).
pub
/// The streak phase at `seconds` of the virtual clock, in `[0, STREAK_WRAP_S)`.
pub