M1c: weather, snap building, shelter, beds and regrowth

- Seeded weather (clear/cloudy/rain/storm, snow and blizzards on cold days
  and above the snowline), lightning, synthesised rain/wind/thunder sound
- Rain/snow particles stopped by roofs; wet ground, settled snow and wind
  via global shader uniforms
- Snap-together wood floor, wall, door, roof and gable with structural
  support, collapse and X to dismantle
- Shelter detection: dry under a roof, warmer and Rested inside with a fire;
  rain burns an uncovered campfire faster
- Bed sets the spawn point and lets you sleep through the night
- Trees, boulders and ground pickups regrow; timers saved
- Grass cleared under floors; shorter HUD hint
- New test_weather_building suite (62 checks) and tests/run_all.sh, which
  also fails on script errors
This commit is contained in:
Paul Bailey
2026-11-04 10:16:41 +00:00
parent fc7eb3cfed
commit fed96ef118
36 changed files with 2421 additions and 58 deletions

View File

@@ -66,8 +66,16 @@ void fragment() {
snow_m *= 1.0 - smoothstep(0.5, 0.7, slope);
col = mix(col, snow_col * (0.92 + 0.08 * fine), snow_m);
// Weather: fresh snow settles on flat ground above the waterline; rain
// darkens and glosses everything else.
float wsnow = snow_mask(w_nrm.y, fine * 0.6 + mid * 0.4) * step(water_level + 0.1, w_pos.y);
col = mix(col, snow_col * (0.9 + 0.1 * fine), wsnow);
snow_m = max(snow_m, wsnow);
float wet = weather_wet * (1.0 - snow_m);
col = wet_albedo(col, wet);
ALBEDO = col;
ROUGHNESS = mix(mix(0.95, 0.82, rock_m), 0.6, snow_m);
ROUGHNESS = mix(mix(mix(0.95, 0.82, rock_m), 0.6, snow_m), 0.4, wet * 0.8);
SPECULAR = 0.3;
NORMAL_MAP = texture(normal_tex, w_pos.xz * 0.35).rgb;
NORMAL_MAP_DEPTH = mix(0.5, 1.4, rock_m) * (1.0 - snow_m * 0.7);