18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 16:27:11 +01:00
Commit Graph

4513 Commits

Author SHA1 Message Date
lcddisplay c0589ae696 Snow windscreen: lumps that stay, in five grids that pile up
A cell of the lumps picked its tile, size and whether it was there at all
from the snow of the map every frame: as the snow grew it turned from
crumbs to a clump to a lump of packed snow, and the dots came and went with
the wetness, so what had landed kept changing and the glass never filled.
Each cell has its lump fixed once now (tile, place, turn, size, and the
snow it takes); it comes when the snow around reaches that, grows a little,
and stays until the snow goes. Five grids, shifted, come one after the
other as the snow piles up (dots and crumbs, puffs, clumps, two of packed
snow), each on the ones before, closing the glass by 3 mm; sooner in a
heap. The dots don't depend on the wetness. No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:12 +01:00
lcddisplay cd7fcd03a2 Snow windscreen: the refraction doesn't punch holes into the snow
The bend request of the snow (all of it since the wet look) makes the
post-processing put 85% of the picture from the bent place, up to 96 px
away, in place of the pixel, with the snow drawn in it: an opaque pixel of
snow took the colour of a gap of the snow elsewhere, so the gaps spread
over the cover and it never closed, however much snow lay there. The bend
is scaled down by the opacity of the snow now (none from 95%): the snow
bends the picture only where it lets the light through. No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:12 +01:00
lcddisplay 873937b3a8 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
2026-11-29 11:39:12 +01:00
lcddisplay 2450612eeb Snow windscreen: wet thick snow closes the glass, flakes stick to snow
- The cover of wet snow (wetness above 0.35, near zero, where the flakes
  land half melted) was drawn with the slush tile, translucent by itself
  (alpha ~0.4), so a glass covered in any amount of it never closed. The
  cover is packed snow once it gets thick (from 0.75 mm, opaque at 2.5 mm),
  greyer when wet by its tone; slush only while it's thin.
- The dry flakes bounced off a moving glass also where snow lay already,
  so the wiped glass (bare, wet from the blade) caught more of them than
  the snow around it. They bounce off a bare glass only now (below
  0.05-0.3 mm of snow); on snow they stick.
No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:12 +01:00
lcddisplay 12218fc6d7 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
2026-11-29 11:39:12 +01:00
lcddisplay 092637afa8 Snow windscreen: the snow piles up into an opaque cover
The lumps of a cell only changed their tile and size as the snow grew, and
the cover stayed translucent (at most 90%), so the glass never closed. A
third grid of lumps lies on top of the cover now (it piles up), the cover
sprites are bigger (2.4 cells), and from 0.75 mm the cover thickens to
opaque at 2.5 mm, bending the picture behind less and less. No assets
change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:12 +01:00
lcddisplay 9c891272a2 Snow windscreen: the snow stays on a moving glass until it's plastered
At speed the air blew the thin dry snow along and off the glass as fast as
it came, and the glass warmed by the cab melted it near zero, so the glass
never got covered. The air blows only the thinnest powder (below 0.2-0.6 mm,
a quarter as fast), the glass is as warm as the given warmth (not 1.5x) and
the air cools it sooner (/(1 + v/10)), and the lumps close into a cover from
0.25 mm. No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:12 +01:00
lcddisplay 21b3cefaee Snow windscreen: the snow looks wet, refracts, and plasters the glass
All the snow bends the picture behind it now through the post-processing
(the icy lumps at 70% of the bend of a drop), not only the drops and the
slush; the cover lets 10-30% of the light through and the snow glints
more (gloss 0.8), so it looks wet in any frost. The lumps run together
into a cover from 0.35 mm of snow (full by about 1 mm), and more snow
comes to a glass not facing it (the eddies 0.6 m/s), so a standing cab's
glass gets plastered too. No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:12 +01:00
lcddisplay 0d770365ff Snow windscreen: the lumps close into a cover
Too much clear glass stayed between the lumps. They're in two grids now,
the second shifted by half a cell, so they overlap; a cell surely has a
lump from 0.5 mm of snow (fewer below), the lumps are bigger, and they run
together into a cover of packed snow from 0.7 mm (full from 2.1 mm), so the
glass gets plastered. No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:12 +01:00
lcddisplay c5adb1db9b Snow windscreen: the same snow on the wiped glass as around it in frost
A blade left a wet trace on any glass, and the snow landing on it there
counted as wet: lumps of slush in the sweep, icy clumps around it. The
trace is left only on a glass above zero now (none below -1 deg C, full
from +1), and the water on a glass below zero freezes into packed snow
(0.02 mm a second, from -2 deg C fully). No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:12 +01:00
lcddisplay 7e7ca904c0 Snow windscreen: icy clumps of grains instead of star crystals, more of them
The tiles of star crystals (single and in flakes, also around the clumps)
are gone from the atlas: every dry tile is now an icy clump of grains, as
the crumbs - a dot, a few grains, small and bigger clumps. Many more of
them (35% of the 7 mm cells holding a little dry snow), the lumps cover the
glass from 1.2 mm of snow (fully by 3.5 mm), and fewer dry flakes bounce
off a moving glass (40% from 25 m/s), so the snow can plaster the glass.

The atlas (snieg_atlas_maszyna.py) changes its tiles 0-5 and 10, 11. To be
added to the SVN: textures/fx/snow-atlas.tga and
textures/fx/snow_normalmap.tga.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:12 +01:00
lcddisplay d8643c42a1 Snow windscreen: sizes in metres of the glass, lumps in heaps
The sprites were sized in texels of the map, and a glass taking only a part
of its uv has big texels: crystals of a few cm (the big stars at speed),
lumps in a coarse even grid. The crystals and drops are in cells of 6 mm of
the glass now, the lumps in cells of 16 mm, from the size of the glass in
the frames of its map. The lumps come in heaps (a random number every four
cells, blended): likelier and bigger there, barer glass between; they sit
anywhere in their cell. Single crystals are needles, plates, rarely a star.
No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:12 +01:00
lcddisplay 2c23d12070 Snow windscreen: no big star flakes, dry powder bounces off a moving glass
The small lumps of dry snow were drawn with the tiles of a few star
crystals, a glass covered in big stars at speed. They're crumbs now (a
flake breaks up hitting the glass); single crystals are rarer (5% of the
texels) and smaller (~5 mm). Dry flakes (below -3 deg C, on dry glass)
bounce off a moving glass: 85% of them from 25 m/s, so dry snow builds up
slowly at speed; the wet ones stay. No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:11 +01:00
lcddisplay 9c2f857210 Snow windscreen: lumps in cells as the drops of the rain, not a sprite per texel
A sprite on every texel holding snow covered the glass in an even pattern
of dots. The snow is drawn now as the rain is: a lump in a cell of four
texels at most, the more snow around the likelier and bigger, sizes from a
few mm to a few cm (most small, wet ones bigger), clear glass between them
until the snow gets thick and packed snow covers it. Single crystals of dry
snow show on 12% of the texels holding a little of it, drops of melted
flakes on some of those holding only water. The haze stays near the snow.

The atlas (snieg_atlas_maszyna.py) gets bigger wet lumps with a bigger
frosted core. To be added to the SVN: textures/fx/snow-atlas.tga and
textures/fx/snow_normalmap.tga.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:11 +01:00
lcddisplay f0e51a8d84 Snow windscreen: the blades wipe the snow as the rain, wet snow refracts
The blades no longer push the snow along into ridges: they take what they
go over (a little stays, a wet trace), as they wipe the rain. Near zero the
flakes land wet, half of them water, and the glass is warmer (the given
warmth x1.5, cooled less by the speed), so the snow turns into lumps of
slush sooner. The wet lumps and the slush of the atlas bend the picture
behind them through the post-processing, as the drops do.

The atlas (snieg_atlas_maszyna.py) changes its tiles 8, 9 and 14: grey
translucent lumps with a frosted core, a darker rim and a dome for the
refraction. To be added to the SVN: textures/fx/snow-atlas.tga and
textures/fx/snow_normalmap.tga.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:11 +01:00
lcddisplay 5c5cf78c17 Snow windscreen: the snow drawn only with sprites of the atlas
The procedural snow (cells with timers, the clumping field, the noise of the
layer and its edge, the wiper mask read in the shader) is gone: what lies on
the glass comes from the map of the simulation, and it's drawn with sprites
of the atlas in two layers, as the drops of the rain and the bugs:
- a flake on every texel holding snow (crystals, flakes of a few of them,
  crumbs; wet lumps; a drop where only the water is left, bending the
  picture behind), the more snow the bigger;
- under them a bigger sprite every three texels where the snow is thicker
  (clumps, packed snow, slush), overlapping into a cover.
A glass without a map (no simulation) has no snow.

Uses a new 4 x 4 atlas (2048 x 2048, snieg_atlas_maszyna.py):
textures/fx/snow-atlas.tga and textures/fx/snow_normalmap.tga, replacing the
2 x 2 ones of the same names. Without them (a 1024 atlas) the shader takes
the four old tiles for the sixteen. To be added to the SVN: the two files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:11 +01:00
lcddisplay 5e605e8126 Deer: the ground of the heightmap terrain counts
On a scenery with heightmap terrain (Tomaszewo: terrain/tomaszewo_hgtmap/)
the deer looked for the ground among the shapes of the scenery only, found
none beside the track and weren't put anywhere ("no ground at 3.0 m" in the
log). Now the height of the heightmap terrain counts as the ground too, and
its bodies of water as water. The chunk under the point is read from its
pack file when it isn't in memory: the deer are put about 2 km ahead of the
camera, where the terrain isn't loaded for drawing yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:11 +01:00
lcddisplay 4a4fac1823 Deer: log why a deer wasn't put at a place
Every attempt that fails says why in the log: a switch, a crossing of roads
or the end of the track ahead; the platform found (its model, or the raised
terrain beside the track); or, for each side, why the way to run away isn't
flat ground: no ground found, water, ground too low or high, a step, or too
much rise and fall. For finding out why no deer appear on a scenery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:11 +01:00
lcddisplay ff023e9047 Deer: keep away from long platforms too, and log where each is put
A platform model is placed by its middle, so a deer by the end of a long one
(peronowe/1k96w400m: 200 m from the middle) was farther than the 150 m looked
at, and was put there. Now a deer is kept 100 m beyond the reach of the model
(its bounding radius), the instances looked through up to 350 m away. Any
model with peron in its path counts (peronowe/..., przytorowe/tszopaperon).

The log tells where each deer was put ("Deer put at x y z").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:11 +01:00
lcddisplay c476316bbd Deer: on curved track too, only the switches keep them away
The track at the place no longer has to be straight: a curve is fine. Only a
switch (or a crossing of roads) from the train to 100 m past the place keeps
a deer from being put there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:11 +01:00
lcddisplay de99a8fc39 Deer: look at the train, only on plain straight track, not by platforms
The flight now has 6 clips instead of 2: the head turned 50, 80 or 110
degrees to the left or to the right. The game picks the one nearest to the
angle between the heading of the deer and the train. Before, clip 0 didn't
turn the head at all and clip 1 always turned it to the left, so the deer
looked away from a train on its right.

A deer is put only where the way from the train to 100 m past the place is
plain track: a switch (or a crossing of roads) on it fails, since the route
may change before the train gets there. The track there also turns at most
3 degrees over 50 m before and after the place.

No deer within 150 m of an instance of a platform model (a folder named
peron..., as peronowe/), nor where the terrain 2.5 or 4 m beside the track
rises 0.45 m over the sleepers (a platform made of terrain).

Assets: animals/jelen_skok.t3d and its VAT textures (jelen_skok_vatpos_hi,
_vatpos_lo, _vatnormal) have to be the ones baked with the 6 clips, in the
order 50, 80, 110, -50, -80, -110 degrees (jelen_anim2.py LOOKS). The deer
animations are kept local for now, not in the SVN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:11 +01:00
lcddisplay 6ca3339df8 Deer only where there's flat ground to bound away over
A deer is put beside the track only where the way it runs away is all over the
terrain of the scenery: ground found under each of the 9 samples of its way,
none of them water (a material named water/woda/wody), no farther than 1.2 m
below or 0.8 m above the sleepers, rising or falling at most 0.45 m between
samples and 1.2 m all along. So no deer on an embankment, in a cutting or by a
river. The side it runs to is picked at random first, then the other one; with
neither flat, the next deer is looked for 200 m on instead of a whole interval.
The ground is sampled when the deer is put there, so the run uses the same
heights. Translucent shapes count as ground too, for water drawn translucent.

Terrain made of models (e3d tiles) gives no ground, so there are no deer there.
No asset changes needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:11 +01:00
lcddisplay 0d0bea2744 Snow windscreen: thin flakes let the light through
A single flake was drawn nearly opaque and lit only from the cab, a dark
speck against the lit snow outside at night. A thin flake is 45% opaque now
(full from 2.5 mm of snow) and the picture behind it is blurred, as through
ice crystals. No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:11 +01:00
lcddisplay f4ae5b826b 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
2026-11-29 11:39:11 +01:00
lcddisplay 94ea972bd9 Snow windscreen: the snow a blade pushes doesn't slip behind it
The snow piled in front of a blade slipped onto its lower neighbours, the
texels the blade had just wiped among them, so it left a stripe of snow on
the wiped glass at every step. Piled snow slips only where no working blade
goes over. No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:11 +01:00
lcddisplay b502311b1e Snow windscreen: a blade leaves the glass clear, not streaks of the snow it pushes
A blade going over the texel holding the snow it pushes left 3% of all of it
there, a stripe of snow for every texel of its way; it leaves 3% of the snow
up to 0.03 mm now, and a wet trace of at most 0.015 mm. A thin film of water
dries and runs off in a few seconds, the water spots are fewer, the haze
needs more snow, the packed snow is whiter. No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:11 +01:00
lcddisplay ba3129275c Snow windscreen: the snow of the glass simulated on a map that keeps it
A glass of mat_snow_windscreen (the material of the "snow:" block, with a
mask of the wipers) gets a slot of the windscreen water storage, as the
glasses of the water could, and two maps of its snow (a step reads one,
writes the other): the snow, the water, how packed the snow is and the shape
of its flakes for each of 256 x 256 texels of its uv. water_snow.comp runs a
step a frame, both APIs:
- the flakes land as many as come to the glass facing the snow against the
  cab (and a few from the eddies), the dry ones bouncing off at speed;
- the blades take the snow they go over (a little stays, a wet trace) and
  push it ahead of themselves, leaving it as ridges at the ends of their
  sweeps; piled snow slips onto its neighbours into a wedge;
- the glass is warmer than the air (the cab is heated, less so at speed):
  above zero the snow melts into water, slush slides down, dry powder is
  blown along by the air at speed, the water runs and dries.
mat_snow_windscreen.frag draws the map: flakes from the atlas where the snow
is thin (water spots where it melted), a layer with a torn edge, as opaque as
it is thick, grey when wet, its relief from the slopes of the map; the wet
glass bends the picture behind through the post-processing. Without the
simulation the glass is drawn as before.

The glasses are found again when a material of the cab changes its kind
(the weather switched its shader). The drop passes run only for glasses of
the water. No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:10 +01:00
lcddisplay 0531cd2726 Rain windscreen: fewer drops left by a blade (wiper_miss 0.005)
No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:10 +01:00
Claude d0ef4130d0 Windscreens: a third of the drops left by a blade, and the snow glass through the post-processing
- rain_cells.glsl: wiper_miss 0.05 -> 0.0167, a blade leaves three times fewer drops where they were
- mat_snow_windscreen.frag (the snow glass, made for the game apart from this repository) added, asking
  the post-processing for its haze and its bent picture through the velocity target as the rain and
  the insects of this version do (rain_windscreen_haze.glsl)

No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:10 +01:00
Claude 87ef243169 Vulkan: define WIPER_PASS_BUCKETS for the shaders
The preamble of the vulkan renderer didn't define it, and with the constants of common.glsl skipped
(MASZYNA_CONSTANTS) the shaders didn't compile: the renderer failed to start and fell back to
opengl. Now defined by the preamble, and common.glsl defines it when the renderer doesn't (an older
exe with these shaders).

No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:10 +01:00
Claude 2fe11d39a1 Rain windscreen: the rain fallen since a blade went over each place of its sweep
The glass took the rain fallen since one of the two moments the blades were at the ends of their
sweep, picked by the way the blade was going. After a pass that gave a place the blade had just
wiped the rain of the sweep before, until the blade reached the other end: the haze and the drops
there jumped back and forth with every sweep (a jump in brightness under the wiper mask, best seen
in a light rain).

Now the renderers keep, for 64 places along the sweep of each blade (the value of the wiper mask),
the rain fallen when the blade last went over them (gl::scene_ubs::wiper_rain_pass, marked for all
the places a blade went over since the last frame), and the glass reads the one of its pixel.
wiper_rain_out / wiper_rain_return are gone; the timers and the insects keep the ends of the sweep.

No assets change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:10 +01:00
Claude c71b32297a OpenGL 4.6: the settings from the values the game gives, also where the driver defines GL_SPIRV
Some drivers (AMD's) define GL_SPIRV also when they compile the GLSL source, so settings.glsl took the specialization
constants, which a source can't have, and no shader compiled ("constant_id: only allowed when generating SPIR-V"). The game
always puts the values of the settings before a source it compiles, so those decide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:10 +01:00
Claude dbad19b92a Rain windscreen: the glass fills up to full in any rain, more slowly in a lighter one
The game now counts the rain the glass meets (more at speed) and how wet the glass is (scene_ubs.rain_state: it fills with the
rain and dries when the rain stops), and the rain fallen when each blade was at the end of its sweep (wiper_rain_out/return).
The glass with rain gets as many drops, droplets, rivulets and as much haze as the heaviest rain gives, scaled by how wet it
is; where a blade went over it they come back with the rain fallen since. A lighter rain only takes longer: 95% full in 10 s of
the heaviest rain standing still, 20 s at cloud cover 1.5, 2.5x as fast at 100 km/h; half dry in 3 minutes standing still.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:10 +01:00
lcddisplay 8050ea8eb6 Deer at the tracks: graze ahead of the train, take fright at the horn and bound away
A deer is put on the path the player's train goes along (world/deer.cpp), grazing. The horn
within deer.hornrange, or the train closer than deer.fleedistance, frightens it: it raises its
head, looks at the train and bounds away from the tracks, then grazes where it stopped. The deer
go once the train is past them; they aren't parts of the scenery (not saved, not edited).

Off unless eu07.ini turns it on: deer (no), deer.interval (2000 m), deer.distance (2000 m),
deer.chance (1), deer.hornrange (600 m), deer.fleedistance (150 m).

- mat_vat.vert (ogl46, vk14): vat_random -1, the game picks the clip and the moment of an instance
  by the fraction of ten times its turn about the vertical, so one animation hands over to the
  next in the very same pose. 0 and 1 work as before.
- TAnimModel::draw_alone(): an instance the game moves leaves the groups of its model.
- scene_walk::Queue_Model: the record of an instance drawn on its own is made anew when the
  instance moved.

Assets (game data, installed locally in the game folder, not yet in the SVN; without them no deer
is made):
- models/animals/jelen_je.t3d, jelen_zryw.t3d, jelen_skok.t3d (the deer of jelen_lewo.t3d with the
  head turned straight, three animations baked by jelen_anim2.py)
- textures/animals/jelen_{je,zryw,skok}.mat and their _vatpos_hi, _vatpos_lo, _vatnormal .tga;
  diffuse animals/sarna_d_1, in winter animals/sarna_f_1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:10 +01:00
lcddisplay d8f0c46c7f Sun shadows of the gpu culling: the replayed walks keep the parameters of the materials
A walk kept from an earlier frame (gfx.gpucull.walkcache) gave the draws of the
shadows the parameters the pass had at the moment, not those of their
materials. mat_vat.vert reads vat_speed from them in the shadow too, so the
shadows of the animals and people animated by textures stood still on
Vulkan with gfx.gpucull.shadows. The common shadow programs read none of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:10 +01:00
Claude 77e4abadae Rain: the cab in the depth prepass also in the rain
In the rain the cab is drawn after the precipitation (so the rain inside it is hidden), and it was left out of the depth
prepass too, so the opaque pass shaded everything behind it. Its depth now goes into the prepass in any weather (Vulkan 1.4,
and OpenGL 4.6 without gfx.depthprepass.replay); the colour of the cab is still drawn after the rain, so nothing changes in
the picture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:10 +01:00
Claude 91d5851ea4 Rain windscreen: a glass looks only at the drops which reach the quarter of its cell
A second pass of rain_cells.comp writes, for every drop cell, which of the drops of the 9 cells around reach each quarter of
it, so a pixel looks at those (usually 1 to 3) instead of all 9. The bias of the drop sizes is applied there too, and the
glass keeps fewer values through its loops (the frame of the glass and the lens are worked out after them, the rivulet of
the pixel is read again where it is needed), so more pixels run at once. The look is the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:09 +01:00
Claude 0683a46817 Rain windscreen: a switch to measure what the glass costs (WS_PROFILE, 0 as in the game) [skip ci]
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:09 +01:00
Claude 394e252daf Rain windscreen: the cells of the drops and rivulets worked out once a frame
The glass with rain worked out, in every pixel, the hashes and the life cycles of the 9 drop cells around it, of the rivulet
cells of its 5 layers and of those the drops are swept by. A compute pass (rain_cells.comp) now does it once a frame for every
cell into a buffer (rain_cells.glsl: RAIN_CELLS_SSBO in the pass set of Vulkan 1.4, binding 18 in OpenGL 4.6); the glass only
reads it, and asks the wipers only for the drops the pixel lies on. The hashes are the same, so the drops and the rivulets
are where they were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:09 +01:00
lcddisplay 339d70a6e6 Moths fly about the lit lamps of the scenery
A part of the lamps of the scenery models which shine downwards (moths.share,
picked by the places of the lamps) gets a swarm of moths: an instance of
animals/cmy.t3d (animated by textures, shader vat) put at the light point when
the lamp first comes within moths.range of the camera. The swarm is shown while
its lamp shines (the light points gathered by the local lights in the frame),
not in the winter and not below moths.temperature. The swarms are made by the
game (basic_node::m_generated): not saved with the scenery, not edited.

Settings (eu07.ini): moths yes/no, moths.share 0-1 (0.4), moths.range metres
(80), moths.temperature degrees (8). Also in the debug window of the lights.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:09 +01:00
Claude 5c3570cadd People animated by textures: the shaders (mat_vat) and the scene block with the place of the camera [skip ci]
The shaders of the animation baked into textures, as tested in the game:
mat_vat.vert / mat_vat.frag for OpenGL 4.6 and Vulkan 1.4, and common.glsl
with camera_hi / camera_lo at the end of the scene block, matching gl/ubo.h
of this branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:09 +01:00
Claude 869df1651e Rain and bugs windscreens: the shaders as tested in the game [skip ci]
- mat_rain_windscreen (v49): longer wind rivulets of different widths, no
  beads gathered by the blades
- mat_bugs_windscreen: the scene blurred only under the see-through parts
  of a bug, no ring around it
- rain_windscreen_haze: exact codes of the drops (MSAA averaged edges are
  neither a drop nor haze), the lights in the drops read in a round
  footprint and fading away from the light
- postfx_taa / postfx_motionblur: the mark of the picture the TAA blurred
  is negative (below any alpha of the scene; the TAA lock takes 0)
- vk14 postfx_dlss_motion: the codes of the windscreens aren't motion

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:09 +01:00
lcddisplay 0df374a5e9 Vulkan 1.4: a material can have its own vertex shader, mat_<name>.vert, also in the sun shadows
As in the OpenGL 4.6 renderer: Fetch_Shader() takes shaders/vk14/mat_<name>.vert when the file is there (the animals and
people animated by textures, mat_vat.vert), vertex.vert otherwise; the multi draw variant is made of the same one. Such a
material gets the programs of its sun shadows with it: its vertex shader with MATERIAL_SHADOW and (alpha)shadowmap.frag,
drawn with all its textures and its params, also from the gpu culling (the draws of one such material go together). The
cube maps of the lamps keep their programs, the depth prepass leaves these materials out (prepass class 0).

The scene block carries the rotation and the place of the camera of each sun cascade and headlight map (inv_view,
camera_hi, camera_lo, gl::set_camera_place()), and those of the view in the colour pass, so the shaders see a model in the
world the same way in every pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:09 +01:00
lcddisplay 2b415fdb16 Textures with the trait r are kept as they are; the scene block carries the place of the camera of the pass
A texture named with :r (the frames of the animations baked into textures, mat_vat) is never scaled down to maxtexturesize
nor compressed by the driver with compresstex: its texels are data, not a picture.

gl::scene_ubs::camera_hi, camera_lo: the place of the camera of the pass in the world, which the models are drawn relative
to, split so both parts are exact in floats. Set with inv_view in every pass that has it (the color pass, the faces of the
environment map, the sun cascades, the headlight shadows, the previews). mat_vat.vert takes the place of a model in the world
from them, so models standing turned the same way still get a moment of the animation of their own, the same in every pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:09 +01:00
lcddisplay f3b70c3886 OpenGL 4.6: the scene block carries the rotation of the shadow pass's own camera
The sun cascades and the headlight shadows draw with the camera of the light, but inv_view stayed the one of the color pass.
mat_vat.vert takes the turn of a model in the world from inv_view and the modelview, so in the shadow passes it saw another
turn, gave the animation another moment, and the shadows of the animated people and animals lagged behind them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:08 +01:00
lcddisplay fd3d081191 OpenGL 4.6: a material can have its own vertex shader, mat_<name>.vert
Fetch_Shader() links mat_<name>.vert with the fragment shader of the material
when the file is there (people animated by textures, mat_vat.vert), the common
vertex.vert otherwise. The multi draw variant takes the same shader with
MODEL_DRAWS. The sun shadows of such materials go through the same vertex
shader with MATERIAL_SHADOW and (alpha)shadowmap.frag, with the textures and
params of the material bound; in the indirect shadow pass they are drawn one by
one. The depth prepass leaves them out (Prepass_Class() 0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXgG7F4L42c2F9sDSAJbT2
2026-11-29 11:39:08 +01:00
Claude 03766899af Windscreen post pass in every frame: drops and haze also standing still, with any anti-aliasing
The velocity target is always drawn and the motion blur pass always runs;
the motion itself is blurred only when the motion blur is on and something
moves (by 0 otherwise). The rain and bugs windscreens send their drops and
haze through it, so they look the same with MSAA, TAA or none, moving or not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:08 +01:00
Claude 12d7fbb00e Windscreen bugs from the insects met: none below 20 km/h, more the faster
The engine counts the insects the vehicle of the wipers meets (seconds of
driving at 100 km/h: nothing below 20 km/h, then (v - 20) / 80 a second) and
gives the count to the shaders in rain_wind.w, with the count of the moments
the blades were at the ends of their sweep in two new vec4 at the end of the
block of the scene (wiper_bugs_out, wiper_bugs_return, next to the timers).
mat_bugs_windscreen grows the dirt from the insects met since the glass was
clean instead of from the time, so a vehicle standing still gets no bugs and
a fast one gets them sooner (full after an hour at 100 km/h).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:08 +01:00
Claude e2a9d5339d Rain on the windscreen: drops of an atlas, haze and refraction in the post-processing
mat_rain_windscreen draws the drops, the micro droplets and the rivulets from
an atlas of drops with its normal map (textures/fx/raindrops-atlas and
raindrops_normalmap, the 2x2 drops on the left, the rivulet sprites on the
right): the drops land, grow and run down, the wipers clear them and they
come back, the air at speed drives many small drops with trails (some of
them long), the haze over the wet glass grows with the rain fallen since the
wiper went over it.

The glass asks the post-processing for its haze and for the view bent by its
drops in the velocity target (rain_windscreen_haze.glsl); postfx_taa.frag
does it every frame with the temporal anti-aliasing (the drops blended with
the last frame at the same pixel, so they don't shimmer with its offsets),
postfx_motionblur.frag without it. The picture of this frame with the depth
of the whole frame, so the cab is never pulled into a drop; the bright
lights of the haze kept from smearing (a karis average with the light it
loses given back up to a limit), the lights in the drops from the mipmaps of
the image of the reflections (OpenGL 4.6).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:08 +01:00
Claude d3920cdd3f Add the windscreen bugs shader (mat_bugs_windscreen) for OpenGL 4.6 and Vulkan 1.4
The spring / summer dirt of the windscreen, ported from the OpenGL 3.3 shader:
insects splat on the glass one by one until it's fully dirty after an hour of
simulation time, the wipers wipe them off where they sweep, a ring of blur
around every splat. The .mat blocks of the seasons name it (szyby.mat of the
cab), and it was missing from both renderers ("cannot read shader").

The syntax of the 4.6 renderers (locations, bindings, #pragma texture /
param, the tuning values as constants), the blur ring through the velocity
target as the haze of rain_windscreen, the colour written straight as
rain_windscreen writes the glass, and no lighting where the glass is clear.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BqfRrTiBDaAyQ2gT6ZrnZD
2026-11-29 11:39:08 +01:00