18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 17:25:00 +01:00

fix(editor): the orthophoto shown one of three ways, the terrain made from the NMT under one rule and around the camera (#334)

* fix(editor): the orthophoto shown one of three ways, chosen in one place, and laid on the terrain without flicker

The settings of the orthophoto had two checkboxes ("Fit to terrain", "Covered by
objects and terrain") and three heights greyed out by turns, and the user couldn't
tell what they did. They're one choice now, each way told under it:

- over the view: drawn over everything, see-through, to compare with the map
- on the terrain, in the scene: tracks and models cover it, lit, the mouse
  places objects on it
- a flat sheet in the scene: for a scenery with no terrain yet

The lift is shown only where it matters (on the terrain, in the scene), the
height is named for what it is in each way ("where there's no ground"), and the
ways in the scene are greyed out with the Better Renderer, which doesn't show
them.

On the terrain in the scene the photos are a copy of the ground's triangles 5 cm
up, which the depth buffer lost further away: they flickered with the terrain
textures. Their shapes are decals now, drawn with a polygon offset towards the
camera (the depth is reversed, so a positive one) in every pass but the shadows.

The translations hold the strings of the terrain of the download area as well.

* fix(editor): the terrain made from the NMT under one rule, also around the camera within the download area

The download area didn't bring the terrain: the NMT squares in it were fetched
only once the model had been placed (its panel opened) and the scenery had
terrain open, and nothing told why. They're fetched from the area as it is now,
in PUWG 1992 already.

Where a chunk is made from the model where there's no terrain, the rule is one
for the track laid, the area and the buttons of the panel (nmt_chunk_offset):
beside terrain made from the model it goes on at its height over the model,
otherwise (terrain made by hand, or none) at the offset of the scenery; no chunk
is left out for what lies beside it. Before, the terrain under the track laid
needed terrain in the scenery and a chunk of it beside, gave up chunks for the
session otherwise, and the model was placed only by its panel.

The terrain of the area: "The terrain of the scenery around the camera" (on by
default, kept with the editor) makes the chunks missing in the area in a square
of 9 x 9 around the camera, the nearest first, as the camera goes. Light: a chunk
at most every 0.1 s and three times as long as it took left to the editor, after
the work with the model the user asked for; the step of the terrain history the
editor keeps open is closed around each chunk, as for the terrain grown while
laying. Not the whole area at once: the chunks made wait in memory to be saved.
The log tells what holds it.

The download of the area gives way to the squares asked for: a square of the
area being downloaded is broken off as one is asked for (the terrain under the
track laid) and taken up again later.

The map no longer covers the area with green over the tiles in the cache, only
the failed ones are red.

* fix(editor): the terrain under the tracks follows them again, a brush stroke keeps its undo, the area terrain timed

From the review of the terrain made from the NMT under one rule:

- The terrain drawn to the tracks place by place (under the tracks) took the
  height of the chunk beside it, carrying one offset along a run of chunks,
  metres off the tracks: nmt_chunk_offset gives the offsets of the tracks there
  again. The height the track laid goes on at (state.ahead) comes from the
  terrain grown under it only, not from the chunks of the buttons.
- A chunk of the area made during a stroke of the terrain brush closed the
  stroke's step of the history, and its undo lost the part brushed before: the
  area terrain waits for the stroke to end.
- In a scenery with no name yet the terrain under the track laid was asked for
  and dropped every half a second, the log filled: nothing is asked for there.

The log tells how long the chunks of the square around the camera took, and the
self-test sets the area terrain on or off for its run (nmtsettings area 0|1).
Measured on lukow.scn: 1.3-1.5 ms a chunk, 2.2 ms the longest; the longest frame
17 ms against 10 ms without it, none over 33 ms.

* fix(editor): the selftest turns the area terrain on or off for its run only, the setting kept

---------

Co-authored-by: maj00r <maj00r@host>
This commit is contained in:
maj00r
2026-11-12 05:04:14 +01:00
committed by GitHub
parent bac9954ad5
commit 39e8bcc59d
12 changed files with 390 additions and 93 deletions

View File

@@ -3195,12 +3195,6 @@ msgstr "Kamera w X %.1f Y %.1f"
msgid "Distance (tiles)"
msgstr "Zasięg (kafle)"
msgid "Fit to terrain"
msgstr "Dopasuj do terenu"
msgid "Lays the imagery onto the ground geometry (terrain shapes, terrain tile models, editor terrain).\nPlaces without any ground use the height below."
msgstr "Kładzie zdjęcia na geometrii gruntu (kształty terenu, modele kafli terenu, teren edytora).\nMiejsca bez gruntu dostają wysokość podaną niżej."
msgid "Refit"
msgstr "Dopasuj ponownie"
@@ -3210,17 +3204,38 @@ msgstr "Dopasowuje zdjęcia od nowa, po zmianach terenu"
msgid "Lift above ground (m)"
msgstr "Uniesienie nad grunt (m)"
msgid "Raises the fitted imagery above the ground. Keep it below the objects you want to see:\nin the scene everything lower than this ends up under the imagery."
msgstr "Unosi dopasowane zdjęcia nad grunt. Trzymaj je poniżej obiektów, które chcesz widzieć:\nw scenie wszystko, co jest niżej, znajdzie się pod zdjęciami."
msgid "Height (m)"
msgstr "Wysokość (m)"
msgid "Covered by objects and terrain"
msgstr "Chowaj za obiektami i terenem"
msgid "Show the photos"
msgstr "Pokaż zdjęcia"
msgid "Draws the imagery as part of the scene, so tracks, models and terrain in front of it hide it.\nIt is lit like the scene. Fully opaque, mouse placement lands on it as on any surface;\ntranslucent, it doesn't catch the mouse.\nNot available with the Better Renderer, which doesn't pick up geometry added in the editor."
msgstr "Rysuje zdjęcia jako część sceny, więc tory, modele i teren przed nimi je zasłaniają.\nJest oświetlone jak scena. W pełni kryjące łapie mysz przy wstawianiu jak każda powierzchnia;\nprzezroczyste nie łapie myszy.\nNiedostępne z Better Renderer, który nie widzi geometrii dodanej w edytorze."
msgid "Over the view"
msgstr "Na wierzchu widoku"
msgid "On the terrain, in the scene"
msgstr "Na terenie, w scenie"
msgid "A flat sheet in the scene"
msgstr "Płaska plansza w scenie"
msgid "The photos lie on the terrain as its surface: tracks and models standing on them cover them, the scene lights them, and fully opaque the mouse places objects on them as on the ground."
msgstr "Zdjęcia leżą na terenie jak jego powierzchnia: tory i modele, które na nich stoją, zasłaniają je, scena je oświetla, a przy pełnym kryciu mysz stawia na nich obiekty jak na gruncie."
msgid "One flat sheet at the height below, in the scene: for a scenery with no terrain yet. Where there is terrain, it cuts through the sheet."
msgstr "Jedna płaska plansza na wysokości podanej niżej, w scenie: dla scenerii, która nie ma jeszcze terenu. Tam, gdzie teren jest, przecina planszę."
msgid "Raises the photos above the ground.\nWhatever is lower than this, the rails and the sleepers too, ends up under them: keep it small."
msgstr "Unosi zdjęcia nad grunt.\nWszystko, co jest niżej, także szyny i podkłady, znajdzie się pod nimi: trzymaj je małe."
msgid "The Better Renderer doesn't show them in the scene: pick \"Over the view\""
msgstr "Better Renderer nie pokazuje ich w scenie: wybierz „Na wierzchu widoku”"
msgid "The photos are drawn over the whole view, over the tracks and models as well: lower the opacity to see what's under them. The quickest way to compare the scenery with the map."
msgstr "Zdjęcia są rysowane na całym widoku, także na torach i modelach: zmniejsz krycie, żeby widzieć, co pod nimi. Najszybszy sposób, by porównać scenerię z mapą."
msgid "Height where there's no ground (m)"
msgstr "Wysokość tam, gdzie nie ma gruntu (m)"
msgid "Opacity"
msgstr "Krycie"
@@ -12267,6 +12282,18 @@ msgstr "Wstrzymaj"
msgid "Terrain model: %d of %d squares in the cache, %d failed"
msgstr "Model terenu: %d z %d kwadratów w pamięci podręcznej, nieudanych %d"
msgid "The terrain of the scenery around the camera"
msgstr "Teren scenerii wokół kamery"
msgid "Makes the terrain from the terrain model within the area, around the camera wherever it goes,\na chunk at a time while the editor is idle. The terrain there is already isn't touched.\nThe chunks made wait in memory until the scenery is saved (Ctrl+S)."
msgstr "Robi teren z NMT w obszarze, wokół kamery, gdziekolwiek pojedzie,\npo jednym kaflu, kiedy edytor nic nie robi. Teren, który już jest, zostaje nietknięty.\nZrobione kafle czekają w pamięci na zapis scenerii (Ctrl+S)."
msgid "%zu chunk made"
msgid_plural "%zu chunks made"
msgstr[0] "%zu kafel zrobiony"
msgstr[1] "%zu kafle zrobione"
msgstr[2] "%zu kafli zrobionych"
msgid "Tab while laying: an arc, then a straight"
msgstr "Tab przy kładzeniu: łuk, potem prosta"