* feat(render): models with lights drawn instanced, behind gfx.instancedlights in eu07.ini Stage 5 of the EU07M model format. A model with lights (lights, Light_On## / Light_Off##), such as a signal head, was drawn instance by instance, a draw call for each part of each one. With gfx.instancedlights 1 the instances of such a model go into the instanced batches like the others, in both renderers, with the culling of the GPU and without it. The default 0 draws them as before. It applies to EU07M and E3D models alike. - The light state of an instance is a word in the element [0][3] of its instance matrix, which an affine matrix leaves unused: bits 0-7 the lit parts shown, bits 8-15 the dark parts, in the mantissa of a float of exponent 128 (0x40000000), a normal number the GPU carries through its matrix products whole. Without that marker the shader draws everything, as before. - model_ubs.light_part says which part of which slot a draw is (0 none, 1 + slot lit, 9 + slot dark); a part the instance doesn't show gets a zero matrix in the vertex shader (instance_hides_part() and effective_modelview() in shaders/vk14/common.glsl and shaders/ogl46/common.glsl). The batch instance shows every light part (TAnimModel::RaPrepareInstanced()). - CPU path: each instance drawn is animated (RaAnimate) and its word put in its matrix (Render_Instanced). GPU culling: the word is in rotationscale[0].w of the instance record, refreshed once a frame for buckets with lights (Refresh_Light_Records), which marks the records to send again when a word changes. - An instance shows the whole lit part or the whole dark one: blinking and switching (ls_On / ls_Off / ls_Blink) change over at half the fade, where the draw instance by instance fades the lit part in over the dark one. Steady states look the same as before. - The freespot lights (TP_FREESPOTLIGHT with flag 0x4000 and no animation) don't keep a model out of the instancing when gfx.instancedlights is on. Light parts aren't put in the ray tracing of an instance batch. Measured on Vulkan, 200 heads s4ipcpb_dd: with gfx.gpucull 0 frame 9.2 ms -> 1.5-2.5 ms and 2400 -> 16 draw calls, with gfx.gpucull 1 9.1 ms -> 3.0 ms and 2410 -> 26 draw calls. Steady light states pixel for pixel the same as drawn instance by instance on all three paths in Vulkan, and on GL 4.6 where the editor panels don't cover them; blinking checked in Vulkan on all three paths (with time let run in the editor for the test only). Not run in the driver mode, blinking not checked on GL 4.6, not built with GCC here. Unit tests 1189/1189. * fix(render): EU07M review of #538: an instance with light colours of its own drawn alone, the light records locked only when stale - An instance with lightcolors of its own isn't instanced: the colours go onto the shared submodels as the instance is prepared, which the instances of a bucket don't each get, so they all showed the colours of one of them. - The walk takes the exclusive lock for the light records of a bucket only when they are stale in this frame (Refresh_Light_Records() checks again under it): the later passes of the frame no longer stop the other walkers. - instance_cull.comp (both renderers) puts the word of the light parts into [0][3] after the product with the view, so a view with a translation can't stretch the first column of a lit instance. - The spec: ls_Dark / ls_Home switch without the fade too, and the instances with light colours of their own.
MaSzyna - Railway vehicle simulator
Website · Report an issue · Community Discord · MaSzyna on Steam · MaSzyna on Epic Games Store
MaSzyna executable source code is licensed under the MPL 2.0 and comes with a large pack of free assets under a custom license.
Table of Contents
Getting Started
MaSzyna compiles and runs natively on Linux and Windows. Other platforms are not tested.
Heads-up
Our dev team is small; we keep improving the build process, but issues may still occur. If you get stuck, please ask on the official Discord server.
Prerequisites
For runtime requirements see Minimum Requirements.
1) Software (oldest tested in parentheses)
Note: MinGW is currently not supported.
2) Libraries (oldest tested in parentheses)
-
GLFW 3.x (3.2.1)
If a link error occurs, pass-DGLFW3_LIBRARIES="<path>"to CMake. -
GLM (0.9.9.0)
-
libserialport (0.1.1)
-
libsndfile (1.0.28)
-
LuaJIT (2.0.5)
-
GLEW (2.1.0)
-
libpng (1.6.34)
-
OpenAL (1.18.2)
-
pthread
-
Python 3.14 (64-bit; headers and import library required for embedding)
-
Asio (1.12)
3) Graphics API
- OpenGL 4.6 (core profile), required by the default renderer; see docs/opengl46-renderer.md
CMake flags
| Flag | Meaning |
|---|---|
-DCMAKE_BUILD_TYPE=Debug |
Debug build |
-DCMAKE_BUILD_TYPE=Release |
Release build |
-DCMAKE_BUILD_TYPE=RelWithDebInfo |
Release build with debug symbols |
-DUSE_SYSTEM_JSON=ON/OFF |
Use an installed nlohmann_json 3.9 or newer (e.g. nlohmann-json3-dev, vcpkg nlohmann-json) instead of the ref/json submodule (default OFF) |
-DPython3_ROOT_DIR=<path> |
Root of the Python 3.14 install on Windows (python.exe, Lib, DLLs) for embed/copy steps; on Linux, optional if CMake picks the wrong interpreter |
macOS note: macOS provides OpenGL only up to 4.1, so the OpenGL 4.6 renderer does not run there.
Windows
Install Python 3.14 x64 from python.org and include the optional Python native development feature (headers and .lib for embedding). Pass -DPython3_ROOT_DIR="C:\Path\To\Python314" on the cmake line when you want the layout under that directory used for embedding and for copying Lib / DLLs next to the executable. The cab screens are drawn with Pillow: install it into that Python (python -m pip install Pillow) before building, so it is copied along with Lib.
AppVeyor CI builds with the worker image’s preinstalled Python at C:/Python314-x64 (see appveyor.yml: -DPython3_ROOT_DIR=...).
# Clone repository with submodules
git clone --recursive https://github.com/MaSzyna-EU07/maszyna.git
cd maszyna
# Init vcpkg
call setup.bat
# Create directory for CMake build files
mkdir build
cd build
# Generate CMake project (replace %CONFIG% with Debug/Release/RelWithDebInfo)
cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=%CONFIG%
# Build (replace %CONFIG% accordingly)
cmake --build . --config %CONFIG% --parallel
Linux
# Install dependencies (Fedora/RHEL family)
sudo dnf install -y \
@development-tools \
cmake \
mesa-libGL-devel \
glew-devel \
glfw-devel \
python3.14-devel \
libpng-devel \
openal-soft-devel \
luajit-devel \
libserialport-devel \
libsndfile-devel \
gcc \
g++ \
wayland-devel \
wayland-protocols-devel \
libxkbcommon-devel
# Clone repository with submodules
git clone --recursive https://github.com/MaSzyna-EU07/maszyna.git
cd maszyna
# Create directory for CMake build files
mkdir build
cd build
# Generate Makefiles
cmake ..
# Compile using all cores
make -j"$(nproc)"
Tip (Ubuntu/Debian): Package names differ; install equivalent
build-essential,libgl1-mesa-dev,libglew-dev,libglfw3-dev,python3.14-dev,libpng-dev,libopenal-dev,libluajit-5.1-dev,libserialport-dev,libsndfile1-dev, and Wayland/X11 dev packages as needed.
Installing
There is no make install yet. Copy the built executable to your MaSzyna installation manually.
-
Output directory:
./bin -
File name format:
eu07_YYYY-MM-DD_<commit>[_d]-
YYYY-MM-DD– build date -
<commit>– short commit hash -
_d– present in Debug builds
-
If you already have the MaSzyna assets, copy the executable to the install dir. Assets can be downloaded from eu07.pl.
Rainsted on Linux
If Rainsted (a third‑party starter) fails to detect the executable under Linux, you can create a small wrapper script named eu07.exe:
#!/bin/sh
./eu07 "$1" "$2" "$3" "$4" "$5"
If detection still fails, padding the file (with comments) up to ~1 MB may help.
Known Issues
-
GLFW linking – On some systems you must provide the GLFW library path explicitly with
-DGLFW3_LIBRARIES. -
X11/Wayland linking order – Linking order of X11 and related libs can matter.
Support
-
Official Discord Server: https://discord.gg/qAh9ctWPQv
-
Project page: https://eu07.pl/
Minimum requirements
- OS: Windows 10 64-bit
- Processor: 4 cores with AVX2 support (e.g. Intel Core i5-4430 / AMD Ryzen 3 1200)
- RAM: 6 GB RAM
- Graphics Card: supporting OpenGL 4.6 with at least 1GB VRAM
- 150 GB of free disk space
- Sound card supporting OpenAL with stereo
- Optional COM ports for custom control panel setups.
License
-
Source code: MPL 2.0
-
Assets: Custom license
