18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 19:57:06 +01:00

Snow windscreen: the snow a blade pushes is counted once

A texel ahead of a blade took the lines of every neighbour pointing at it,
and the lines overlapped, so the snow pushed along grew at every step and
the ends of the sweeps filled with ridges even on a glass with hardly any
snow. A texel in the sweep takes only the line behind itself along the way
of the blade, one off the sweep the line of one neighbour. 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-10 21:42:57 +01:00
committed by Claude
parent 94ea972bd9
commit f4ae5b826b
2 changed files with 30 additions and 2 deletions
+15 -1
View File
@@ -11,7 +11,8 @@
// the water runs down as a film and is pushed by the air; and snow piled higher than its neighbours by more than it holds slips
// onto them (a ridge left by a blade spreads into a wedge). what goes over the edge of the glass falls off
// - the blades: a blade going over a texel in the step takes its snow (a little stays, and a wet trace of the water), and pushes
// it on in front of itself: the texel just ahead of the line of texels the blade went over gets their snow, packed. at the end
// it on in front of itself: the texel just ahead of the line of texels the blade went over gets their snow, packed (each texel
// to one texel at most: the snow pushed along is never counted twice). at the end
// of its sweep the blade leaves it there, a ridge; pushed past the edge of the glass, it's gone
// - the flakes land: as many as come to the glass facing the snow coming at it against the cab (and a few in the eddies of the
// air where it doesn't face it), each bringing its snow to the texel; the faster the vehicle the more of the dry ones bounce off
@@ -267,6 +268,16 @@ void main()
crossed = true;
continue;
}
// every texel the blade went over goes to one texel ahead at most, so the snow it pushes isn't counted twice (it would
// grow at every step): in the sweep the texel takes the line of texels behind itself along the way of the blade, off the
// sweep (the blade pushes the snow out at its edge) the line of one of its neighbours pointing at it
if (snow_blade(texel, blade) > 0.001)
{
ivec2 way = snow_blade_way(texel, blade);
if ((way != ivec2(0)) && snow_crossed(texel - way, blade))
pushed += snow_line(texel - way, blade, way);
continue;
}
for (int k = 0; k < 8; ++k)
{
ivec2 from = texel + SNOW_AROUND[k];
@@ -274,7 +285,10 @@ void main()
continue;
ivec2 way = snow_blade_way(from, blade);
if ((way != ivec2(0)) && (from + way == texel))
{
pushed += snow_line(from, blade, way);
break;
}
}
}
if (crossed)
+15 -1
View File
@@ -11,7 +11,8 @@
// the water runs down as a film and is pushed by the air; and snow piled higher than its neighbours by more than it holds slips
// onto them (a ridge left by a blade spreads into a wedge). what goes over the edge of the glass falls off
// - the blades: a blade going over a texel in the step takes its snow (a little stays, and a wet trace of the water), and pushes
// it on in front of itself: the texel just ahead of the line of texels the blade went over gets their snow, packed. at the end
// it on in front of itself: the texel just ahead of the line of texels the blade went over gets their snow, packed (each texel
// to one texel at most: the snow pushed along is never counted twice). at the end
// of its sweep the blade leaves it there, a ridge; pushed past the edge of the glass, it's gone
// - the flakes land: as many as come to the glass facing the snow coming at it against the cab (and a few in the eddies of the
// air where it doesn't face it), each bringing its snow to the texel; the faster the vehicle the more of the dry ones bounce off
@@ -270,6 +271,16 @@ void main()
crossed = true;
continue;
}
// every texel the blade went over goes to one texel ahead at most, so the snow it pushes isn't counted twice (it would
// grow at every step): in the sweep the texel takes the line of texels behind itself along the way of the blade, off the
// sweep (the blade pushes the snow out at its edge) the line of one of its neighbours pointing at it
if (snow_blade(texel, blade) > 0.001)
{
ivec2 way = snow_blade_way(texel, blade);
if ((way != ivec2(0)) && snow_crossed(texel - way, blade))
pushed += snow_line(texel - way, blade, way);
continue;
}
for (int k = 0; k < 8; ++k)
{
ivec2 from = texel + SNOW_AROUND[k];
@@ -277,7 +288,10 @@ void main()
continue;
ivec2 way = snow_blade_way(from, blade);
if ((way != ivec2(0)) && (from + way == texel))
{
pushed += snow_line(from, blade, way);
break;
}
}
}
if (crossed)