18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 03:37:09 +01:00
Files
maszyna/.gitmodules
T
maj00r d8e6c6e36e feat(model): the game loads .e4d models, behind modelformat e4d in eu07.ini
Stage 2 of the E4D model format. With modelformat e4d a model with an .e4d file beside its .e3d / .t3d is loaded from it;
legacy, the default, leaves the .e4d files alone and the game loads models exactly as before. The key is written to the
log at the start.

- TModel3d::LoadFromE4D (model/e4d/e4d_load.cpp) builds the same tree of submodels LoadFromBinFile builds from E3D,
  and both go on through the same finish_binary() (the end of the E3D loading, moved out of deserialize unchanged).
  .mmd, events, GetFromName and the editor work as before. A file that can't be read or isn't valid is logged and the
  .e3d / .t3d is loaded instead. TModelsManager finds a model which comes as an .e4d alone.
- Format additions found by comparing loads (the format isn't released, so still version 1.0):
  - the LMAT component: the material of a node without geometry (light points, rotators), whose light threshold,
    colours and material the lights use;
  - node_flags::no_transform: an E3D submodel without a matrix, told apart from one with the identity matrix;
  - section_flags::meshopt: the vertex and index streams in the codecs of meshoptimizer (vertex codec version 1,
    index sequence codec), lossless, several times faster to unpack than zstd on this data. zstd packs the other
    sections; zstd over the coded streams is an option for archives (write_options::compress_streams).
- meshoptimizer v1.3 (MIT) as a submodule in ref/meshoptimizer; only its vertex and index codecs are built, into
  eu07_core.
- Loading speed: the big streams unpack on threads of their own, and a model of 100 000 vertices or more fills the
  vertices and indices of its submodels on up to 8 threads (std::jthread); the vertices are written once, without the
  zeroes of resize(). QTangent decoding takes the two matrix columns it needs without a square root.
- eu07 -e4d diff <e3d|t3d> <e4d> [dynamic] compares the two loads submodel by submodel and times them.

Checked:
- 250 random models of the installed game: all convert, and loaded from E4D they give the same tree, names, flags,
  materials and indices as from E3D; positions and UVs bit for bit, transforms within 6.5e-5, normals within 0.03 deg
  (4 vertices with a broken normal in the E3D get a proper one).
- Size 39% of the E3D (263 MB against 682 MB). Load outside the game, with the files in the system's cache: 516 ms
  against 561 ms, 0.75 of the time for the models of 5 MB and more, 1.21 for the smaller ones.
- In the game on Vulkan (self-test, the same 250 models): 3.05 s against 3.15 s to load them, the same frame time and
  device memory, the picture within 1/255 of the legacy one.
- Unit tests 1189/1189, among them the codecs with and without zstd, a codec on a wrong section and a cut stream. Not
  built with GCC here.

No asset change is needed: the game data has no .e4d files, and the release doesn't read them.
2026-11-28 20:55:57 +01:00

42 lines
1.3 KiB
Plaintext

[submodule "ref/glm"]
path = ref/glm
url = https://github.com/g-truc/glm.git
[submodule "ref/yaml-cpp"]
path = ref/yaml-cpp
url = https://github.com/jbeder/yaml-cpp.git
[submodule "ref/glfw"]
path = ref/glfw
url = https://github.com/glfw/glfw
[submodule "ref/asio"]
path = ref/asio
url = https://github.com/chriskohlhoff/asio.git
[submodule "ref/discord-rpc"]
path = ref/discord-rpc
url = https://github.com/discord/discord-rpc.git
branch = v3.4.0
[submodule "ref/vcpkg"]
path = ref/vcpkg
url = https://github.com/microsoft/vcpkg.git
[submodule "ref/json"]
path = ref/json
url = https://github.com/nlohmann/json
[submodule "ref/volk"]
path = ref/volk
url = https://github.com/zeux/volk.git
[submodule "ref/Vulkan-Headers"]
path = ref/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers.git
[submodule "ref/VulkanMemoryAllocator"]
path = ref/VulkanMemoryAllocator
url = https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
[submodule "ref/glslang"]
path = ref/glslang
url = https://github.com/KhronosGroup/glslang.git
[submodule "ref/wamr"]
path = ref/wamr
url = https://github.com/bytecodealliance/wasm-micro-runtime
shallow = true
[submodule "ref/meshoptimizer"]
path = ref/meshoptimizer
url = https://github.com/zeux/meshoptimizer.git