From 12218fc6d7bf623aa043c87115bd39010a22374c Mon Sep 17 00:00:00 2001 From: lcddisplay Date: Wed, 11 Nov 2026 20:42:25 +0100 Subject: [PATCH] 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 Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD --- shaders/ogl46/water_snow.comp | 10 +++++++--- shaders/vk14/water_snow.comp | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/shaders/ogl46/water_snow.comp b/shaders/ogl46/water_snow.comp index dd3a369c0..251800ed1 100644 --- a/shaders/ogl46/water_snow.comp +++ b/shaders/ogl46/water_snow.comp @@ -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) diff --git a/shaders/vk14/water_snow.comp b/shaders/vk14/water_snow.comp index d972d2052..fcafd5bc5 100644 --- a/shaders/vk14/water_snow.comp +++ b/shaders/vk14/water_snow.comp @@ -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)