From f4c93564db1e69ca7a2af30fcc85676b4d05feca Mon Sep 17 00:00:00 2001 From: lcddisplay Date: Wed, 11 Nov 2026 21:01:37 +0100 Subject: [PATCH] Snow windscreen: a front glass at speed gets the snow coming at it A front glass at speed built up its snow no faster than a standing one: the flakes come at a glass by the relative wind along its outward normal, and the outward side of the frames of the map (from the middle of the box around the cab model) and the air against the cab (from the matrix of the vehicle and its velocity) don't agree for every cab; with them disagreeing the glass got the snow of the eddies only (1.5 mm a minute), never closed between the lumps. The glass takes the snow coming at it along its normal from either side now (the glass the driver looks through leads); where the sides agree nothing changes. No assets change. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD --- shaders/ogl46/water_snow.comp | 7 ++++++- shaders/vk14/water_snow.comp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/shaders/ogl46/water_snow.comp b/shaders/ogl46/water_snow.comp index 313d67866..7680b570e 100644 --- a/shaders/ogl46/water_snow.comp +++ b/shaders/ogl46/water_snow.comp @@ -248,7 +248,12 @@ void main() water_frame_s frame = snow_frame(texel); float area = length(cross(frame.tu, frame.tv)) / float(WATER_MAP * WATER_MAP); // m2 vec3 coming = water_air.xyz - water_up.xyz * water_air.w; // the snow against the cab, m/s - float facing = max(-dot(coming, frame.normal), 0.0) + SNOW_EDDIES; + // the snow coming at the glass along its normal. the side of the glass the snow comes from isn't told: the outward side of + // the frames of the map (from the middle of the box around the cab model) and the air against the cab (from the matrix of + // the vehicle and its velocity) don't agree for every cab, and with them disagreeing a front glass at speed got the snow of + // the eddies only, plastered no faster than a standing one. the glass the driver looks through leads, so the snow comes at + // it from the outside + float facing = abs(dot(coming, frame.normal)) + SNOW_EDDIES; float density = mix(SNOW_FRESH, SNOW_PACKED, state.z); float wet = state.y / (state.y + state.x * density + 1e-4); // the dry flakes bounce off a moving glass (powder is blown away), the wet ones (near zero) and those landing on wet snow or diff --git a/shaders/vk14/water_snow.comp b/shaders/vk14/water_snow.comp index 52345a264..4a8ee2dcb 100644 --- a/shaders/vk14/water_snow.comp +++ b/shaders/vk14/water_snow.comp @@ -251,7 +251,12 @@ void main() water_frame_s frame = snow_frame(texel); float area = length(cross(frame.tu, frame.tv)) / float(WATER_MAP * WATER_MAP); // m2 vec3 coming = water_air.xyz - water_up.xyz * water_air.w; // the snow against the cab, m/s - float facing = max(-dot(coming, frame.normal), 0.0) + SNOW_EDDIES; + // the snow coming at the glass along its normal. the side of the glass the snow comes from isn't told: the outward side of + // the frames of the map (from the middle of the box around the cab model) and the air against the cab (from the matrix of + // the vehicle and its velocity) don't agree for every cab, and with them disagreeing a front glass at speed got the snow of + // the eddies only, plastered no faster than a standing one. the glass the driver looks through leads, so the snow comes at + // it from the outside + float facing = abs(dot(coming, frame.normal)) + SNOW_EDDIES; float density = mix(SNOW_FRESH, SNOW_PACKED, state.z); float wet = state.y / (state.y + state.x * density + 1e-4); // the dry flakes bounce off a moving glass (powder is blown away), the wet ones (near zero) and those landing on wet snow or