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

8 Commits

Author SHA1 Message Date
maj00r 92cc2dcc28 refactor(model): the new model format is EU07M (.eu07m), not E4D
E4D read as the next version of E3D, which the format isn't meant to be tied to; EU07M goes with the world format .eu07.
The format isn't released, so nothing reads the old name.

- The extension .eu07m, the magic EU7M (the four bytes of the header), model/eu07m/ with eu07m_*.{h,cpp},
  namespace eu07m, docs/eu07m-format.md, tests/unit/test_eu07m.cpp.
- The command line -eu07m convert|dump|validate|diff, TModel3d::LoadFromEU07M, and the key modelformat eu07m|legacy
  of eu07.ini (Global.modelformat_eu07m).
- Nothing else changes: the sections, the records and the components are the same, so a converted file needs only its
  magic and its extension changed.

Unit tests 1189/1189.
2026-11-28 22:02:05 +01:00
maj00r 5185d69dc9 feat(render): the Vulkan renderer keeps the vertex streams of E4D models as they are, 28 bytes a vertex
Stage 3 of the E4D model format. A model loaded from .e4d (modelformat e4d) reaches the Vulkan renderer as its compact
streams: positions (12 B), attributes (QTangent snorm16x4 + uv f32x2, 16 B), user data and indices, without the 48-byte
gfx::basic_vertex in between.

- gfx: gfx::compact_attributes, geometry_bank::create_compact() and GfxRenderer->Insert_Compact(). The default of
  Insert_Compact decodes to basic_vertex, so the OpenGL 4.6 and the null renderers get the models as before. The CPU
  readers of a chunk (pantograph, bounds, picking, the editor) get basic_vertex made from the streams the first time they
  read it; a chunk which is changed (replace, append) turns into basic_vertex first.
- Vulkan: a bank whose chunks are all compact keeps positions, user data, attributes and indices in buffers of their own;
  vertex_kind::scene_compact reads them (location 5 the quaternion as R16G16B16A16_SNORM). A program gets a COMPACT_VERTEX
  variant the first time a compact chunk is drawn with it, in the background with gfx.vulkan.asyncresources, as the
  MODEL_DRAWS one; the variant of the multi draws makes a compact one of its own. Only vertex.vert and cabprobe.vert
  decode the normal (compact_frame() in common.glsl); the shaders of shadows, prepass, picking and cube shadows read
  position and uv as before.
- Ray tracing: the BLAS of a compact chunk reads the positions with a stride of 12, and the reflections read the normal
  and uv from the attributes (RT_FLAG_COMPACT in the record). Not tried with ray tracing on.
- The loader hands the streams of the file to Insert_Compact as they are; the stars keep their colours in the normals
  of basic_vertex and go as before.

Measured on Vulkan (self-test, 250 models of the game, runs alternating with legacy): device memory 1.60-1.64 GiB
against 1.89 GiB, GPU time a frame 1.27-1.39 ms against 1.37-1.57 ms, the same frame time and load time, the picture
within 1/255 of the legacy one, no errors of Vulkan in the log. Unit tests 1189/1189; -e4d diff gives the same results
through the new decode. Not built with GCC here.
2026-11-28 21:52:47 +01:00
Hirek ad71963a4e fix(render): the Vulkan renderer checks its cache files, backs off when memory runs out and keeps its threads alive through any exception 2026-11-25 15:29:31 +01:00
Hirek b8815a2455 Optimise raytracing and buffer building 2026-11-16 22:19:17 +01:00
Hirek 71a6628a4a Vulkan ray tracing: shade the heightmap terrain from its layers; longer default SSR range 2026-10-25 17:15:58 +01:00
Hirek e201c83825 Vulkan ray tracing: trace only visible reflections, sun shadow from the shadow map, foliage switch and timings 2026-10-25 16:09:19 +01:00
Hirek 08f4f6ed60 Vulkan ray tracing: include tracks and roads, build triangle strips and fans 2026-10-25 15:35:26 +01:00
Hirek f20b1a3071 Replace cubemap scenery reflections with SSR, add Vulkan ray traced reflections 2026-10-25 13:54:49 +01:00