17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-18 00:59:18 +02:00
Files
maszyna/shaders
maj00r 9408216ae7 Give the terrain its own archive, its normals, and a level per tile
The tiles moved out of the scenery's pak into an archive of their own: a
sorted index of fixed-size entries found by where a tile sits in the
quadtree rather than by a name, each entry compressed on its own so a
tile can be read without touching the rest. A name apiece would have been
seventy megabytes of index to read before the first tile could be drawn.

An entry carries what its tile's ground asks for - how far it departs
from the finest mesh, and how long its triangles are - because which
level to draw has to be settled for tiles that are not on the card yet,
and the index is the only thing about them that is read up front. Until
now the figure came from the tile's level, which is the worst tile in it,
so one steep corner spoke for every tile that shared its level.

The mesh carries a normal per vertex, octahedron-encoded into two bytes,
in place of the face normal the fragment stage worked out from how the
view position changed across a triangle. A face normal makes the ground
read as facets, and a coarser level's facets face differently from the
ones they stand for, so the light over a hillside changed as the level
did. A geometry stage hands the fragment stage the three materials of the
triangle it is in and the barycentric weights, so ground changes over a
triangle rather than along its edge; 3.3 has no gl_BaryCoordEXT.

And the level a tile is drawn at now counts the camera's height. The
distance was measured on the ground plane alone, which puts the tile
underfoot nought metres away from a camera a kilometre above it - and
nought metres asks for the finest level there is, so a view from the air
wanted the whole ground at full detail, more tiles than the buffers hold,
and what would not fit came out as holes.

Archives written under the old rules are refused at the door and baked
again.
2026-09-20 21:22:03 +02:00
..
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2024-07-10 22:59:03 +02:00
2020-02-21 22:50:52 +01:00
2020-11-18 22:18:28 +01:00
2020-11-18 22:18:28 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2026-08-17 18:51:36 +02:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2021-01-23 22:24:14 +01:00
2021-01-23 22:24:14 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2021-01-23 22:24:14 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2026-05-09 23:29:20 +02:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2020-02-21 22:50:52 +01:00
2026-05-09 23:29:20 +02:00
2026-05-09 23:29:20 +02:00