17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 13:19:20 +02:00
Commit Graph

57 Commits

Author SHA1 Message Date
maj00r
592d1687d5 feat(track): the texture of a shared running surface blends into the texture of the rail it lies on: 2 cm on each side of the boundary both are drawn in tinted variants of their materials that fade per vertex into the mean colour of the two treads, sampled from the texture files, so the edge of the wheels of the other track leaves a soft band instead of a line 2026-10-14 00:01:20 +02:00
maj00r
7e20023d07 feat(track): where two rails share a running surface it takes the texture whose running surface is brighter; the brightness is read from the texture file over the u range of the rail head top, the shared parts are the block of crossing grooved rails, the nose of an acute frog from its tip to the end of the V, the through rail across a wide or grooved crossing, the frog of a switch, and the stock rails of a switch with frogs up to half the blade length where the blade grows to a full head 2026-10-13 22:36:09 +02:00
maj00r
f067824014 feat(renderer): a matte variant of a material for the parts of rails no wheel rolls on: it lights the same maps as weathered steel, with the weathering scaled per vertex by userdata, so a polished running surface fades into unused steel without a bright stripe; the cut faces of rails are drawn in it in an extra pass 2026-10-13 18:30:16 +02:00
jerrrrycho
8125166690 Fix/sonar reliability security (#205)
* fix(sonar): addressing reliability/security issues

* fix(sonar): addressing reliability/security issues

* fix(sonar): addressing reliability/security issues

* fix(sonar): addressing last reliability/security issues

* fix(sonar): addressing last reliability/security issues

* fix(sonar): addressing last reliability/security issues

* refactor(sonar): imgui update

* refactor(sonar): hasChar revert
2026-10-11 15:31:45 +02:00
35bda3778c Heightmap terrain: .tch chunk packs, streaming with LOD, terrain painting, water and modifiers - terrain/<name>/terrain.yaml + <px>_<pz>.tch packs of 16x16 chunks (250 m, 0.5/1/2/5 m spacing), slices with crc-32 and optional zstd (vendored zstd 1.5.6 in ref/zstd) - heightmap_terrain [name] endheightmap_terrain directive replaces editorterrain - streamer: worker threads, camera + look-ahead loading, geomipmap LOD with skirts, pooled geometry - mat_terrain shader: up to 8 painted layer materials per chunk via texture arrays (opengl33); other renderers fall back to the dominant material - water bodies (outline + level), terrain modifiers (vertical profile shaping kept non-destructive) - F11 Terrain work mode rebuilt: chunks, sculpt, smooth, paint, point spacing, water tools 2026-10-09 21:02:25 +02:00
maj00r
e910615bf6 removed draw limit in track editor 2026-10-09 15:37:23 +02:00
9b0e88db7a feat(editor): node bank shows the entries as cards with the previews of their models (Previews, size of the cards 48-256 px, kept in eu07_editor.ini), in the groups and with the search as the list; images found by the names the preview generator gives them, worked out by the same code now (editor/editorPreviews: path of the model and skin, numbers of entries with the same ones in the order of nodebank.txt), read and scaled down in a thread of their own, uploaded a few in a frame, at most 512 kept, read anew on Reload node bank; images of the user interface made by the gl renderers (Create_Image/Release_Image of the imgui renderer, srgb in the modern one); Polish translation 2026-10-08 23:55:56 +02:00
344034ec70 feat(ui): imgui 1.91.9b-docking in place of 1.73: local changes of the backends carried over (glad as the gl loader, srgb and gamma of the ui, gles glsl string), BufferingBar/Spinner kept, imgui_tables in cmake; cursor position, cursor enter and focus of the main window passed to the glfw backend, which works with events now; code adapted to the api: ImGuiListClipper::Begin, BeginListBox, ImTextureID as an integer, ImageButton with an id, ImGuiKey without GetKeyIndex, logarithmic sliders in place of the removed power argument; ImGuizmo with the math operators defined before imgui.h and SetNextFrameWantCaptureMouse 2026-10-08 20:38:13 +02:00
e661b9f1c7 feat(editor): -generate-nodebank-previews mode: png previews of the node bank models, or of the entries given with -entries, drawn offscreen and without a window by the full renderer: square, -resolution 1024 by default, the model in perspective from the front, side and above, fitted to the image less -margin pixels (64 by default) on white background, lit, with materials and with self shadows unless -no-shadows; saved in textures/previews/nodebank under the path of the model with the skin; software rendering of mesa when the graphics driver gives no gl 3.3 or with -software 2026-10-08 18:52:51 +02:00
917c8f7285 Merge branch 'master' into feat/modern-editor 2026-10-08 17:44:58 +02:00
28b4e57133 feat(loading): optional background loading: sound files decoded by worker threads (sound.asyncload), data of dds textures read by worker threads (gfx.textures.streaming), gl textures of vehicles farther than a multiple of the draw range released (gfx.textures.releasedistance); all off by default 2026-10-08 16:17:46 +02:00
e335b89fcb perf(tracks): geometry of neighbouring tracks of a cell which share the material drawn together, with one material bind and one upload of model data; chunks of the same geometry bank sent to the gpu in a single multi draw call 2026-10-07 17:13:32 +02:00
398fdac6a1 perf(instancing): instances of scene cells culled by copies of their bounds kept with the buckets, before the instances themselves are fetched; instances past the range of the lod stages of their model left out; identity of the instance buffer restored once per bucket instead of after each batch 2026-10-07 16:29:15 +02:00
bc99b80191 perf(reflections): environment map drawn one face per frame from the place the update began at, the first update in one go; cells beyond the range of reflected instances left out; time of the reflection pass in the renderer statistics; tracks skipped in shadow passes no longer counted as drawn 2026-10-07 16:17:13 +02:00
maj00r
978b99b7e5 feat(scenery): models laid along curves (sweep nodes), bent to follow the paths or repeated along them, loaded and saved with the scenery; trainsets put on a path while the simulation runs; trainset turned around by reversed after its header: the first vehicle stays at the offset and leads towards point 1, the rest stands behind it; launcher keeps reversed trainsets and can turn one around; memory cells saved with the new name of the path they name; events tell their targets and the events of a multiple event; renderer tells whether the cursor is over a surface; vehicle placed in the editor entered when the driving goes on 2026-10-06 22:19:32 +02:00
jerrrrycho
79bd0c8e91 fix(sonar): addressing reliability/security issues (#202) 2026-10-04 20:00:13 +02:00
maj00r
e69601dfa0 Structure gauge: no red highlight of the intruding triangles 2026-10-04 02:27:52 +02:00
maj00r
b0c363b586 feat: structure gauge along the line of the selected path in the OpenGL view 2026-10-04 01:27:41 +02:00
maj00r
fc195880e1 refactor(editor): one place for the orthographic projection of the editor view 2026-10-04 00:52:14 +02:00
pawelw
51521a135a Text displays: accept characters above 127, in windows-1250 or utf-8 (#198)
* Text displays: accept characters above 127, in windows-1250 or utf-8

A text display (sub-model of type "text") looks up the sub-model of each character
in a 256 entry table, and indexed it with a plain char. With char being signed, any
character above 127 gave a negative index: reading the text went outside the table,
and so did filling the table if a character sub-model had such a name. In effect the
displays could only show ASCII, and a text with national characters could crash.

The lookup is now keyed by unicode code point. Both the displayed text and the names
of the character sub-models are decoded as utf-8 if they are valid utf-8, and as
windows-1250 otherwise, so legacy (ansi) sceneries and models work next to utf-8
ones, and the two can be mixed. A short ansi text can be valid utf-8 by accident
(two upper case accented letters in a row will do); when both readings are possible
the one which finds more of its characters in the model is used.

The rest is unchanged: the first character of the text still isn't displayed, the
characters are still drawn in the translucent pass only. A missing text pointer no
longer gets dereferenced.

* Text displays: prepare the characters once for each text

The sequence of character sub-models was cached for the last text only, so
displays of several instances drawn in turn decoded their texts again on
every draw. It is now kept for each text the display shows; the texts of the
instances don't change, so a draw costs a single lookup.

Also the comments added in the renderers are now in English.

* Text displays: move the text decoding to utilities

utf8_to_utf32() and win1250_to_utf32(), with the windows-1250 table, now sit
next to win1250_to_utf8(). The existing function maps only the Polish letters
and passes other bytes above 127 through, so it can't serve the displays.

* Text displays: address the SonarCloud findings

std::array instead of the C-style arrays, the utf-8 sequence length worked
out in a function of its own instead of nested conditional operators,
std::byte for the bit operations, std::ranges::count_if and contains().
The character loop of the renderers moved to Render_Alpha_text(), which
takes the nesting back to the limit, and the static pasText is accessed
through the class.
2026-10-03 12:05:32 +02:00
maj00r
78c4b9f6df feat(editor): add orthographic top view toggle 2026-10-03 02:41:34 +02:00
09e02a75a7 Merge pull request #195 from MaSzyna-EU07/fix/instancing
Improve instancing rendering speed
2026-10-01 20:18:19 +02:00
jerrrrycho
06078ddab9 fix: other sonar sast fixes (#193) 2026-10-01 13:30:25 +02:00
d670c4b116 perf(instancing): skip models without shadow casters in shadow passes 2026-10-01 12:57:33 +02:00
2130d175e9 perf(instancing): cache instance rotation and group lod bands linearly 2026-10-01 12:43:07 +02:00
20f536f05e fix(instancing): keep batches correct after load-time classification 2026-10-01 11:51:41 +02:00
jerrrrycho
f05b58b0e9 Revert "fix: yet other sonar sast fixes"
This reverts commit 403a6d1f9f.
2026-10-01 08:01:23 +02:00
jerrrrycho
403a6d1f9f fix: yet other sonar sast fixes 2026-10-01 07:58:28 +02:00
551f6dbc3b seasonal model variants for vehicle exterior model 2026-09-28 20:49:18 +02:00
jerrrrycho
8fbb482350 feat(materials): texture randomization for loads
* feat(materials): texture randomization for loads
2026-09-27 00:09:16 +02:00
Sebastian Krzyszkowiak
c58d218fe7 opengl33renderer: Don't render stars with strong fog (#134)
Stars aren't currently affected by fog. Band-aid it and don't render them
at all when fog is stronger than 500m.
2026-07-15 21:48:27 +02:00
Sebastian Krzyszkowiak
fdc9ea7099 opengl33renderer: Brighten up the clouds
With tonemapping, clouds need to stand out above 1.0 to reach proper
white levels.

Note that this should get disabled if tonemapping isn't used, in case
it's made properly configurable in the future.
2026-06-30 05:42:55 +02:00
Sebastian Krzyszkowiak
f2a7cc4f98 opengl33renderer: Adjust sun intensity based on overcast 2026-06-30 01:56:39 +02:00
1aac9b4e76 Merge pull request #111 from MaSzyna-EU07/opengl-instancing
Some rendering improvements
2026-06-16 23:09:12 +02:00
c0abea1473 Merge pull request #109 from docentYT/fix-compilation-warnings
Fix compilation warnings
2026-06-16 11:14:25 +02:00
426ee0baac use textureGather for shadow PCF 2026-05-26 22:08:06 +02:00
26c11ddca9 Improve sleeper LOD calculation 2026-05-24 15:22:44 +02:00
64a65b81ea Sleeper culling + Cell-level distance pre-cull 2026-05-23 20:36:41 +02:00
aff225c95f Global frame buckets 2026-05-23 19:28:29 +02:00
1be56de0fa Add sleepermodel optional parameter for tracks 2026-05-19 22:10:47 +02:00
docentYT
e95e00a2e2 Use texture id casting recommended by ImGui wiki 2026-05-12 18:04:50 +02:00
3419666070 scale/endscale/localscale per node model 2026-05-10 13:12:49 +02:00
587077629f Enable instancing 2026-05-09 23:29:20 +02:00
b7283d8fb9 Instanced object grouping 2026-05-07 12:13:47 +02:00
7525b54ff1 Enable GLM_FORCE_DEFAULT_ALIGNED_GENTYPES 2026-05-06 20:41:01 +02:00
docentYT
ca699d117f Remove not needed includes 2026-05-02 14:40:31 +02:00
docentYT
3628eb0fc3 Replace interpolate with std::lerp and glm::mix 2026-05-02 01:31:38 +02:00
docentYT
d1f16411a1 Replace clamp with std::clamp 2026-05-01 22:14:29 +02:00
7acc34df3e Merge pull request #97 from docentYT/migrate-from-dumb3d-to-glm
Migrate from dumb3d to glm
2026-04-28 19:46:46 +02:00
docentYT
ca839652bf Use the sq function to force constexpr expressions for numeric literals and enhance readability 2026-04-28 13:23:14 +02:00