This page is not yet adapted for Transport Fever 3. The content may be outdated.
Shaders are small data processing programm snippets that are used by the GPU to calculate what is drawn on the screen. This covers the 3D meshes as well as textures. Beside the lighting and shadowing, atmospheric effects like the reyleigh scattering, light emission and other effects are realized with shaders too.
There are several graphics libraries on the market, that can be used as standardized APIs for graphic visualization. The most common are DirectX® and OpenGL®. Transport Fever 3 uses the the Vulkan® Graphics API and the shaders are programmed in the OpenGL® Shading Language Version 1.50.
Each shader actually is a pipeline of several shader stages. Usually, these are:
For Transport Fever 3, the shader related files are located in content/rendering/programs/shaders/. The vertex shaders .vs, geometry shaders .gs and fragment shaders .fs are compiled by the game on load to be used ingame. To recompile them after some changes, use AltGr + R ingame.
There are five groups of shaders:
Each material type is defined in a mat.lua file:
function data() return { legacyName = "PHYS_TRANSPARENT_NRML_MAP", prefix = "TN", properties = { { name = "two_sided", id = "properties/two_sided.prop", }, { name = "map_albedo_opacity", id = "properties/map_albedo_opacity.prop", }, ... }, renderPasses = { COLOR = { needsAlphaBlending = true, needsBlend4 = false, programName = "programs/color_alpha_diffuse.prog" }, ... }, technique = "techniques/standard_transparent.tec", transparent = true, needsTangentVertexAttrib = false, hasSmoothLod = false, order = 60, } end
The properties are:
legacyName is used e.g. in the Model Editor.prefix is a short abbreviation that can be used for quick assignments in .fbx files.properties contains all property and map definitions for the material. See below for more details.renderPasses contains a list of render passes that are executed. See below for more details.technique is a reference to a .tec file. See below.transparent is a boolean attribute flagging this material as a transparent one. This is important for the render order.needsTangentVertexAttrib is a boolean attribute
.hasSmoothLod
.