18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 17:46:48 +01:00

Snow windscreen: the map gets all the snowfall, and melts as fast as it can

Two reasons the glass never got plastered:
- the flakes a second the renderer gives (water_snow.x) are a quarter of
  the snowfall (the 0.25 of perground, meant to thin out the particles of
  the drop passes), so the map got a quarter of the snow: a glass not
  facing the motion (standing, side windows) built up 0.4 mm a minute,
  6.5 minutes to opaque. It takes all of it now (x4): 1.5 mm a minute.
- the warm glass melted 0.003 mm of water a second for each degree above
  zero, ~1 kW/m2 a degree, so near zero a standing cab melted the snow
  4-5 times as fast as it came. 0.0002 mm (~70 W/m2 a degree) now.
No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
This commit is contained in:
lcddisplay
2026-11-11 20:42:25 +01:00
committed by Claude
parent 092637afa8
commit 12218fc6d7
2 changed files with 14 additions and 6 deletions
+7 -3
View File
@@ -43,8 +43,12 @@ const float SNOW_WIPE_LEFT = 0.03;
const float SNOW_WIPE_WATER = 0.1;
const float SNOW_WIPE_TRACE = 0.08;
const float SNOW_WIPE_WET = 0.015;
// the water the snow melts into at the glass a second for each degree the glass is above zero, mm
const float SNOW_MELT = 0.003;
// the water the snow melts into at the glass a second for each degree the glass is above zero, mm (the heat the glass passes on,
// ~70 W/m2 a degree, melts 0.0002 mm of water a second)
const float SNOW_MELT = 0.0002;
// the share of the snowfall the flakes of water_snow.x make (the renderer counts a quarter of them, as for the particles of the
// drop passes): the snow of the map gets all of it
const float SNOW_FALL_SHARE = 4.0;
// how much warmer than the air the glass is, the share of the warmth given (water_snow.y, the cab heats it)
const float SNOW_WARMTH = 1.0;
// the share of a flake landing near zero already water (wet snow)
@@ -251,7 +255,7 @@ void main()
// water stay
float dry = (1.0 - smoothstep(0.1, 0.4, wet)) * (1.0 - smoothstep(-3.0, 0.0, water_up.w));
float sticking = 1.0 - 0.4 * smoothstep(5.0, 25.0, speed) * dry;
float landings = water_snow.x / max(water_air.w, 0.1) * facing * area * seconds * sticking;
float landings = water_snow.x * SNOW_FALL_SHARE / max(water_air.w, 0.1) * facing * area * seconds * sticking;
vec4 random = water_random(place, snow_slot, water_counts.x, 0x5e0du);
float count = min(floor(landings) + ((random.x < fract(landings)) ? 1.0 : 0.0), 4.0);
if (count > 0.0)
+7 -3
View File
@@ -46,8 +46,12 @@ const float SNOW_WIPE_LEFT = 0.03;
const float SNOW_WIPE_WATER = 0.1;
const float SNOW_WIPE_TRACE = 0.08;
const float SNOW_WIPE_WET = 0.015;
// the water the snow melts into at the glass a second for each degree the glass is above zero, mm
const float SNOW_MELT = 0.003;
// the water the snow melts into at the glass a second for each degree the glass is above zero, mm (the heat the glass passes on,
// ~70 W/m2 a degree, melts 0.0002 mm of water a second)
const float SNOW_MELT = 0.0002;
// the share of the snowfall the flakes of water_snow.x make (the renderer counts a quarter of them, as for the particles of the
// drop passes): the snow of the map gets all of it
const float SNOW_FALL_SHARE = 4.0;
// how much warmer than the air the glass is, the share of the warmth given (water_snow.y, the cab heats it)
const float SNOW_WARMTH = 1.0;
// the share of a flake landing near zero already water (wet snow)
@@ -254,7 +258,7 @@ void main()
// water stay
float dry = (1.0 - smoothstep(0.1, 0.4, wet)) * (1.0 - smoothstep(-3.0, 0.0, water_up.w));
float sticking = 1.0 - 0.4 * smoothstep(5.0, 25.0, speed) * dry;
float landings = water_snow.x / max(water_air.w, 0.1) * facing * area * seconds * sticking;
float landings = water_snow.x * SNOW_FALL_SHARE / max(water_air.w, 0.1) * facing * area * seconds * sticking;
vec4 random = water_random(place, snow_slot, water_counts.x, 0x5e0du);
float count = min(floor(landings) + ((random.x < fract(landings)) ? 1.0 : 0.0), 4.0);
if (count > 0.0)