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

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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
This commit is contained in:
lcddisplay
2026-11-11 21:01:37 +01:00
parent 169aeadf49
commit f4c93564db
2 changed files with 12 additions and 2 deletions
+6 -1
View File
@@ -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
+6 -1
View File
@@ -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