From 925f5910bb6638a5f0d1bbe1a2dea1017266a8e2 Mon Sep 17 00:00:00 2001 From: Hirek193 Date: Wed, 21 Oct 2026 23:36:03 +0200 Subject: [PATCH] refactor(track): the ballast fades into that of the tracks joined, as the rails do --- application/editormodetrackprops.cpp | 4 +- lang/editor_pl.po | 8 +-- model/material.cpp | 15 +++-- model/material.h | 9 ++- rendering/opengl46/opengl46renderer.cpp | 6 +- rendering/opengl46/opengl46renderer.h | 2 +- rendering/renderer.h | 4 +- shaders/mat_trackblend.frag | 2 +- shaders/mat_trackblend_grain.frag | 11 ---- shaders/mat_trackblend_normalmap.frag | 2 +- shaders/mat_trackblend_normalmap_grain.frag | 20 ------- shaders/mat_trackblend_parallax.frag | 2 +- shaders/mat_trackblend_parallax_grain.frag | 23 -------- shaders/mat_trackblend_specgloss.frag | 2 +- shaders/mat_trackblend_specgloss_grain.frag | 19 ------- shaders/trackblend.glsl | 63 +-------------------- world/TrackBlend.cpp | 2 +- world/TrackBlend.h | 4 +- 18 files changed, 32 insertions(+), 166 deletions(-) delete mode 100644 shaders/mat_trackblend_grain.frag delete mode 100644 shaders/mat_trackblend_normalmap_grain.frag delete mode 100644 shaders/mat_trackblend_parallax_grain.frag delete mode 100644 shaders/mat_trackblend_specgloss_grain.frag diff --git a/application/editormodetrackprops.cpp b/application/editormodetrackprops.cpp index 53da7159..d0961aa8 100644 --- a/application/editormodetrackprops.cpp +++ b/application/editormodetrackprops.cpp @@ -507,8 +507,8 @@ std::vector make_properties() } { // the ends of a plain track are p1 and p2, a switch has p4 as the end of its second path - char const *const ends[][3] = {{"blend1", "Texture blending at p1 (m)", "How far from the end p1 the rails and the ballast blend into those of the track joined there, where their textures differ.\nThe ballast comes in as stones mixed together, the rails fade into each other; 0: not blended"}, - {"blend2", "Texture blending at p2 (m)", "How far from the end p2 the rails and the ballast blend into those of the track joined there, where their textures differ.\nThe ballast comes in as stones mixed together, the rails fade into each other; 0: not blended"}, + char const *const ends[][3] = {{"blend1", "Texture blending at p1 (m)", "How far from the end p1 the rails and the ballast blend into those of the track joined there, where their textures differ, fading into each other; 0: not blended"}, + {"blend2", "Texture blending at p2 (m)", "How far from the end p2 the rails and the ballast blend into those of the track joined there, where their textures differ, fading into each other; 0: not blended"}, {"blend3", "Texture blending at p4 (m)", "How far from the end p4 of the switch its trackbed blends into the ballast of the track joined there, where their textures differ; 0: not blended"}}; for (int end = 0; end < 3; ++end) { diff --git a/lang/editor_pl.po b/lang/editor_pl.po index 764abd00..2b62bf27 100644 --- a/lang/editor_pl.po +++ b/lang/editor_pl.po @@ -10270,11 +10270,11 @@ msgstr "Mieszanie tekstur przy p2 (m)" msgid "Texture blending at p4 (m)" msgstr "Mieszanie tekstur przy p4 (m)" -msgid "How far from the end p1 the rails and the ballast blend into those of the track joined there, where their textures differ.\nThe ballast comes in as stones mixed together, the rails fade into each other; 0: not blended" -msgstr "Na jakiej długości od końca p1 szyny i podsypka przechodzą w te z toru tam dołączonego, gdy ich tekstury są różne.\nPodsypka miesza się kamieniami, szyny przenikają się płynnie; 0: bez mieszania" +msgid "How far from the end p1 the rails and the ballast blend into those of the track joined there, where their textures differ, fading into each other; 0: not blended" +msgstr "Na jakiej długości od końca p1 szyny i podsypka płynnie przechodzą w te z toru tam dołączonego, gdy ich tekstury są różne; 0: bez mieszania" -msgid "How far from the end p2 the rails and the ballast blend into those of the track joined there, where their textures differ.\nThe ballast comes in as stones mixed together, the rails fade into each other; 0: not blended" -msgstr "Na jakiej długości od końca p2 szyny i podsypka przechodzą w te z toru tam dołączonego, gdy ich tekstury są różne.\nPodsypka miesza się kamieniami, szyny przenikają się płynnie; 0: bez mieszania" +msgid "How far from the end p2 the rails and the ballast blend into those of the track joined there, where their textures differ, fading into each other; 0: not blended" +msgstr "Na jakiej długości od końca p2 szyny i podsypka płynnie przechodzą w te z toru tam dołączonego, gdy ich tekstury są różne; 0: bez mieszania" msgid "How far from the end p4 of the switch its trackbed blends into the ballast of the track joined there, where their textures differ; 0: not blended" msgstr "Na jakiej długości od końca p4 rozjazdu jego podsypka przechodzi w podsypkę toru tam dołączonego, gdy ich tekstury są różne; 0: bez mieszania" diff --git a/model/material.cpp b/model/material.cpp index 46a26781..640f509c 100644 --- a/model/material.cpp +++ b/model/material.cpp @@ -766,13 +766,13 @@ int constexpr blend_specgloss { 4 }; // added to the lighting for a material wit int constexpr blend_parallax { 8 }; // added to the lighting (1, normalmap) of a parallax material std::string -blend_shader( int const Lighting, bool const Grain ) { +blend_shader( int const Lighting ) { std::string name { "trackblend" }; if( Lighting & blend_specgloss ) { name += "_specgloss"; } else if( Lighting & blend_parallax ) { name += "_parallax"; } else if( Lighting > 0 ) { name += "_normalmap"; } - return ( Grain ? name + "_grain" : name ); + return name; } } // namespace @@ -820,7 +820,7 @@ material_manager::blend_lighting( material_handle const Material ) { } if( lighting >= 0 ) { // the parameters of the material go to the blending one as they are, so they have to be in the same places in both - auto const blend { GfxRenderer->Fetch_Shader( blend_shader( lighting, false ) ) }; + auto const blend { GfxRenderer->Fetch_Shader( blend_shader( lighting ) ) }; auto const fits { std::all_of( std::begin( material.shader->param_conf ), std::end( material.shader->param_conf ), [&]( auto const &Entry ) { @@ -864,7 +864,6 @@ material_manager::build_blend( blend_key const &Key, opengl_material &Blend ) { auto const material { std::get<0>( Key ) }; std::array const others { std::get<1>( Key ), std::get<2>( Key ), std::get<3>( Key ) }; - auto const grain { std::get<4>( Key ) }; auto const lighting { blend_lighting( material ) }; if( lighting < 0 ) { return false; @@ -885,8 +884,8 @@ material_manager::build_blend( blend_key const &Key, opengl_material &Blend ) { int const normalslots[] = { ( specgloss ? 3 : 4 ), ( specgloss ? 4 : 5 ), ( specgloss ? 5 : 6 ), 7 }; auto const ends { specgloss ? 2 : 3 }; try { - Blend = variant_of( m_materials[ material ], grain ? ":blendgrain" : ":blend" ); - Blend.shader = GfxRenderer->Fetch_Shader( blend_shader( lighting, grain ) ); + Blend = variant_of( m_materials[ material ], ":blend" ); + Blend.shader = GfxRenderer->Fetch_Shader( blend_shader( lighting ) ); Blend.texture_variants.clear(); Blend.textures.fill( null_handle ); auto const owndiffuse { texture_of( material, "diffuse" ) }; @@ -922,12 +921,12 @@ material_manager::build_blend( blend_key const &Key, opengl_material &Blend ) { } material_handle -material_manager::create_blend( material_handle const Material, std::array const &Others, bool const Grain ) { +material_manager::create_blend( material_handle const Material, std::array const &Others ) { if( false == blendable( Material ) ) { return Material; } - blend_key const key { Material, Others[ 0 ], Others[ 1 ], Others[ 2 ], Grain }; + blend_key const key { Material, Others[ 0 ], Others[ 1 ], Others[ 2 ] }; if( auto const lookup { m_blends.find( key ) }; lookup != m_blends.end() ) { return lookup->second; } diff --git a/model/material.h b/model/material.h index 42c71800..802ac6ea 100644 --- a/model/material.h +++ b/model/material.h @@ -148,10 +148,9 @@ public: material_handle create_tinted( material_handle const Material, glm::vec3 const &Colour ); // the material of a track blending its texture with those of up to three others (null: none) by the weights in y, z and w of - // the user data of the vertices (mat_trackblend), as grains with Grain. returns: handle to it, made once, or the material - // itself where it can't be blended + // the user data of the vertices (mat_trackblend). returns: handle to it, made once, or the material itself where it can't be blended material_handle - create_blend( material_handle const Material, std::array const &Others, bool const Grain ); + create_blend( material_handle const Material, std::array const &Others ); // whether the material can be blended so: a diffuse texture lit as mat_default, or with a normal map (and a specgloss map) // lit as normalmap, sunlessnormalmap or shadowlessnormalmap (and their _specgloss), or parallax; not tinted. the blending materials take the // textures of another season or weather with the materials they blend @@ -172,8 +171,8 @@ private: // types typedef std::vector material_sequence; typedef std::unordered_map index_map; - // a blending material: the material of the track, those it blends into at the ends, whether in grains - using blend_key = std::tuple; + // a blending material: the material of the track, those it blends into at the ends + using blend_key = std::tuple; // methods: // checks whether specified texture is in the texture bank. returns texture id, or npos. material_handle diff --git a/rendering/opengl46/opengl46renderer.cpp b/rendering/opengl46/opengl46renderer.cpp index 926404f0..edf314e0 100644 --- a/rendering/opengl46/opengl46renderer.cpp +++ b/rendering/opengl46/opengl46renderer.cpp @@ -2850,9 +2850,9 @@ material_handle opengl46_renderer::Tinted_Material(material_handle const Materia return m_materials.create_tinted(Material, Colour); } -material_handle opengl46_renderer::Blend_Material(material_handle const Material, std::array const &Others, bool const Grain) +material_handle opengl46_renderer::Blend_Material(material_handle const Material, std::array const &Others) { - return m_materials.create_blend(Material, Others, Grain); + return m_materials.create_blend(Material, Others); } bool opengl46_renderer::Blendable_Material(material_handle const Material) @@ -4405,7 +4405,7 @@ int opengl46_renderer::Prepass_Class( material_handle const Material ) "detail_normalmap", "detail_normalmap_specgloss", "normalmap", "normalmap_specgloss", "reflmap", "reflmap_specgloss", "shadowlessnormalmap", "shadowlessnormalmap_specgloss", "sunlessnormalmap", "sunlessnormalmap_specgloss", - "trackblend", "trackblend_grain", "trackblend_normalmap", "trackblend_normalmap_grain", "trackblend_specgloss", "trackblend_specgloss_grain" }; + "trackblend", "trackblend_normalmap", "trackblend_specgloss" }; static std::unordered_set const solid { "colored", "default_0", "terrain", "water", "water_specgloss", "invalid" }; auto prepassclass { 0 }; for( auto const &shader : m_shaders ) { diff --git a/rendering/opengl46/opengl46renderer.h b/rendering/opengl46/opengl46renderer.h index 44bc7efe..8696b220 100644 --- a/rendering/opengl46/opengl46renderer.h +++ b/rendering/opengl46/opengl46renderer.h @@ -102,7 +102,7 @@ class opengl46_renderer : public gfx_renderer { material_handle Tinted_Material( material_handle const Material, glm::vec3 const &Colour ) override; material_handle - Blend_Material( material_handle const Material, std::array const &Others, bool const Grain ) override; + Blend_Material( material_handle const Material, std::array const &Others ) override; bool Blendable_Material( material_handle const Material ) override; void diff --git a/rendering/renderer.h b/rendering/renderer.h index 037be58c..a9cf6edf 100644 --- a/rendering/renderer.h +++ b/rendering/renderer.h @@ -112,8 +112,8 @@ public: virtual auto Matte_Material( material_handle const Material ) -> material_handle { return Material; } virtual auto Tinted_Material( material_handle const Material, glm::vec3 const &Colour ) -> material_handle { return Material; } // the material of a track blending its texture with those of up to three others (null: none) by the weights in y, z and w of the user data - // of the vertices, the others as grains with Grain (world/TrackBlend.h). backends which can't make one give back the material itself - virtual auto Blend_Material( material_handle const Material, std::array const &Others, bool const Grain ) -> material_handle { return Material; } + // of the vertices (world/TrackBlend.h). backends which can't make one give back the material itself + virtual auto Blend_Material( material_handle const Material, std::array const &Others ) -> material_handle { return Material; } // whether a material can be blended so virtual auto Blendable_Material( material_handle const Material ) -> bool { return false; } // heightmap terrain: material of a chunk blending the materials of up to 8 layers by their weights. diff --git a/shaders/mat_trackblend.frag b/shaders/mat_trackblend.frag index d9b6456f..ea067cec 100644 --- a/shaders/mat_trackblend.frag +++ b/shaders/mat_trackblend.frag @@ -1,4 +1,4 @@ -// the rails of a track faded into those of the tracks joined at its ends, see trackblend.glsl +// the rails and the ballast of a track faded into those of the tracks joined at its ends, see trackblend.glsl #texture (diffuse, 0, sRGB_A) uniform sampler2D diffuse; #texture (diffuse1, 1, sRGB_A) diff --git a/shaders/mat_trackblend_grain.frag b/shaders/mat_trackblend_grain.frag deleted file mode 100644 index 6003b453..00000000 --- a/shaders/mat_trackblend_grain.frag +++ /dev/null @@ -1,11 +0,0 @@ -// the ballast of a track mixed in grains into that of the tracks joined at its ends, see trackblend.glsl -#define TRACKBLEND_GRAIN 1 -#texture (diffuse, 0, sRGB_A) -uniform sampler2D diffuse; -#texture (diffuse1, 1, sRGB_A) -uniform sampler2D diffuse1; -#texture (diffuse2, 2, sRGB_A) -uniform sampler2D diffuse2; -#texture (diffuse3, 3, sRGB_A) -uniform sampler2D diffuse3; -#include diff --git a/shaders/mat_trackblend_normalmap.frag b/shaders/mat_trackblend_normalmap.frag index 996a83fd..468c70cd 100644 --- a/shaders/mat_trackblend_normalmap.frag +++ b/shaders/mat_trackblend_normalmap.frag @@ -1,4 +1,4 @@ -// the rails of a track of a normal mapped material faded into those of the tracks joined at its ends, see trackblend.glsl +// the rails and the ballast of a track of a normal mapped material faded into those of the tracks joined at its ends, see trackblend.glsl #define TRACKBLEND_NORMALMAP 1 #texture (diffuse, 0, sRGB_A) uniform sampler2D diffuse; diff --git a/shaders/mat_trackblend_normalmap_grain.frag b/shaders/mat_trackblend_normalmap_grain.frag deleted file mode 100644 index 537f79d3..00000000 --- a/shaders/mat_trackblend_normalmap_grain.frag +++ /dev/null @@ -1,20 +0,0 @@ -// the ballast of a track of a normal mapped material mixed in grains into that of the tracks joined at its ends, see trackblend.glsl -#define TRACKBLEND_GRAIN 1 -#define TRACKBLEND_NORMALMAP 1 -#texture (diffuse, 0, sRGB_A) -uniform sampler2D diffuse; -#texture (diffuse1, 1, sRGB_A) -uniform sampler2D diffuse1; -#texture (diffuse2, 2, sRGB_A) -uniform sampler2D diffuse2; -#texture (diffuse3, 3, sRGB_A) -uniform sampler2D diffuse3; -#texture (normalmap, 4, RGBA) -uniform sampler2D normalmap; -#texture (normalmap1, 5, RGBA) -uniform sampler2D normalmap1; -#texture (normalmap2, 6, RGBA) -uniform sampler2D normalmap2; -#texture (normalmap3, 7, RGBA) -uniform sampler2D normalmap3; -#include diff --git a/shaders/mat_trackblend_parallax.frag b/shaders/mat_trackblend_parallax.frag index 42e07e86..5ee5a465 100644 --- a/shaders/mat_trackblend_parallax.frag +++ b/shaders/mat_trackblend_parallax.frag @@ -1,4 +1,4 @@ -// the rails of a track of a parallax material faded into those of the tracks joined at its ends, see trackblend.glsl +// the rails and the ballast of a track of a parallax material faded into those of the tracks joined at its ends, see trackblend.glsl #define TRACKBLEND_NORMALMAP 1 #define TRACKBLEND_PARALLAX 1 #param (height_scale, 2, 1, 1, zero) diff --git a/shaders/mat_trackblend_parallax_grain.frag b/shaders/mat_trackblend_parallax_grain.frag deleted file mode 100644 index 5db1da68..00000000 --- a/shaders/mat_trackblend_parallax_grain.frag +++ /dev/null @@ -1,23 +0,0 @@ -// the ballast of a track of a parallax material mixed in grains into that of the tracks joined at its ends, see trackblend.glsl -#define TRACKBLEND_GRAIN 1 -#define TRACKBLEND_NORMALMAP 1 -#define TRACKBLEND_PARALLAX 1 -#param (height_scale, 2, 1, 1, zero) -#param (height_offset, 2, 2, 1, zero) -#texture (diffuse, 0, sRGB_A) -uniform sampler2D diffuse; -#texture (diffuse1, 1, sRGB_A) -uniform sampler2D diffuse1; -#texture (diffuse2, 2, sRGB_A) -uniform sampler2D diffuse2; -#texture (diffuse3, 3, sRGB_A) -uniform sampler2D diffuse3; -#texture (normalmap, 4, RGBA) -uniform sampler2D normalmap; -#texture (normalmap1, 5, RGBA) -uniform sampler2D normalmap1; -#texture (normalmap2, 6, RGBA) -uniform sampler2D normalmap2; -#texture (normalmap3, 7, RGBA) -uniform sampler2D normalmap3; -#include diff --git a/shaders/mat_trackblend_specgloss.frag b/shaders/mat_trackblend_specgloss.frag index 6b7f1c0d..436552e1 100644 --- a/shaders/mat_trackblend_specgloss.frag +++ b/shaders/mat_trackblend_specgloss.frag @@ -1,4 +1,4 @@ -// the rails of a track of a material with normal and specgloss maps faded into those of the tracks joined at its ends, see trackblend.glsl +// the rails and the ballast of a track of a material with normal and specgloss maps faded into those of the tracks joined at its ends, see trackblend.glsl #define TRACKBLEND_NORMALMAP 1 #define TRACKBLEND_SPECGLOSS 1 #texture (diffuse, 0, sRGB_A) diff --git a/shaders/mat_trackblend_specgloss_grain.frag b/shaders/mat_trackblend_specgloss_grain.frag deleted file mode 100644 index d144b3ad..00000000 --- a/shaders/mat_trackblend_specgloss_grain.frag +++ /dev/null @@ -1,19 +0,0 @@ -// the ballast of a track of a material with normal and specgloss maps mixed in grains into that of the tracks joined at its ends, see trackblend.glsl -#define TRACKBLEND_GRAIN 1 -#define TRACKBLEND_NORMALMAP 1 -#define TRACKBLEND_SPECGLOSS 1 -#texture (diffuse, 0, sRGB_A) -uniform sampler2D diffuse; -#texture (diffuse1, 1, sRGB_A) -uniform sampler2D diffuse1; -#texture (diffuse2, 2, sRGB_A) -uniform sampler2D diffuse2; -#texture (normalmap, 3, RGBA) -uniform sampler2D normalmap; -#texture (normalmap1, 4, RGBA) -uniform sampler2D normalmap1; -#texture (normalmap2, 5, RGBA) -uniform sampler2D normalmap2; -#texture (specgloss, 6, RGBA) -uniform sampler2D specgloss; -#include diff --git a/shaders/trackblend.glsl b/shaders/trackblend.glsl index b3d6c3cd..a38caf4b 100644 --- a/shaders/trackblend.glsl +++ b/shaders/trackblend.glsl @@ -1,7 +1,6 @@ // a track drawn with the textures of the tracks joined at its ends blended in near them (world/TrackBlend.h): the weights of the -// tracks joined at the ends p1, p2 and p4 of a switch in UserData.yzw, their textures in diffuse1..3, normalmap1..3. the -// including shader declares the textures and sets: -// TRACKBLEND_GRAIN the others come in as grains, as the stones of two ballasts would mix, rather than faded in +// tracks joined at the ends p1, p2 and p4 of a switch in UserData.yzw, their textures in diffuse1..3, normalmap1..3, faded into +// the texture of the track. the including shader declares the textures and sets: // TRACKBLEND_NORMALMAP with the normal maps of the four, lit as the shader of the material of the track: param[2].x 0 as // mat_default, 1 normalmap, 2 sunlessnormalmap, 3 shadowlessnormalmap // TRACKBLEND_SPECGLOSS the specgloss map of the track itself as well, the textures of the ends p1 and p2 alone (no room @@ -38,49 +37,6 @@ layout(location = 1) out vec4 out_motion; #include #include -#ifdef TRACKBLEND_GRAIN -// grains per repeat of the texture: a ballast texture repeats every few metres, a grain is a handful of its stones -const float GRAIN_CELLS = 28.0; - -vec2 grain_hash2(vec2 p) -{ - vec3 q = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973)); - q += dot(q, q.yzx + 33.33); - return fract((q.xx + q.yz) * q.zy); -} - -float grain_hash1(vec2 p) -{ - vec3 q = fract(vec3(p.xyx) * 0.1031); - q += dot(q, q.yzx + 33.33); - return fract((q.x + q.y) * q.z); -} - -// the value of the grain the point lies in, 0..1: cells around points jittered on a grid, each of one value -float grain_value(vec2 p) -{ - vec2 cell = floor(p); - vec2 inside = fract(p); - float nearest = 8.0; - float value = 0.0; - for (int y = -1; y <= 1; ++y) - { - for (int x = -1; x <= 1; ++x) - { - vec2 offset = vec2(float(x), float(y)); - vec2 r = offset + grain_hash2(cell + offset) - inside; - float d = dot(r, r); - if (d < nearest) - { - nearest = d; - value = grain_hash1(cell + offset + 17.31); - } - } - } - return value; -} -#endif - #ifdef TRACKBLEND_PARALLAX // the texture coordinates shifted by the heights (b) of the normal map, as ParallaxMapping() of mat_parallax.frag vec2 parallax_coord(sampler2D heights, vec2 coord, vec3 viewdir, vec2 dcoorddx, vec2 dcoorddy) @@ -142,12 +98,6 @@ void main() vec2 dy = dFdy(f_coord); #ifdef TRACKBLEND_PARALLAX vec3 viewdir = normalize(vec3(0.0) - TangentFragPos); -#endif -#ifdef TRACKBLEND_GRAIN - vec2 grainpos = f_coord * GRAIN_CELLS; - // grains smaller than a pixel would shimmer, there the textures fade into each other instead - float footprint = max(length(dx), length(dy)) * GRAIN_CELLS; - float grained = 1.0 - smoothstep(0.35, 0.9, footprint); #endif vec2 coord = TRACKBLEND_COORD(normalmap); vec4 tex_color = textureGrad(diffuse, coord, dx, dy); @@ -156,15 +106,6 @@ void main() #endif if (total > 0.0) { -#ifdef TRACKBLEND_GRAIN - // the grain is of the track joined at the end whose share its value falls in, of the track itself past them - float pick = grain_value(grainpos); - float first = weights.x; - float second = weights.x + weights.y; - vec3 grain = vec3(float(pick < first), float(pick >= first && pick < second), float(pick >= second && pick < total)); - weights = mix(weights, grain, grained); - total = weights.x + weights.y + weights.z; -#endif vec4 blended = tex_color * (1.0 - total); #ifdef TRACKBLEND_NORMALMAP vec4 blendednormal = tex_normal * (1.0 - total); diff --git a/world/TrackBlend.cpp b/world/TrackBlend.cpp index b72be5ee..1d51ecec 100644 --- a/world/TrackBlend.cpp +++ b/world/TrackBlend.cpp @@ -230,7 +230,7 @@ blending setup( TTrack const &Track, kind const Kind ) { return {}; } auto const own { material_of( Track, Kind, 0 ) }; - auto const material { GfxRenderer->Blend_Material( own, others, Kind == kind::ballast ) }; + auto const material { GfxRenderer->Blend_Material( own, others ) }; if( material == own ) { // the renderer can't blend them return {}; diff --git a/world/TrackBlend.h b/world/TrackBlend.h index 8dedf6e7..6599d556 100644 --- a/world/TrackBlend.h +++ b/world/TrackBlend.h @@ -21,8 +21,8 @@ class TTrack; // the rails and the ballast of a track blended into those of the tracks joined at its ends, where their textures differ: near // an end the vertices carry the weight of the track joined there (y, z, w of their user data for the ends p1, p2 and p4 of a -// switch) and the track is drawn with a material blending its texture with theirs. the ballast comes in as grains, the rails -// fade into each other. a plain track blends its rails and its ballast, a switch the trackbed made for it +// switch) and the track is drawn with a material fading its texture into theirs. a plain track blends its rails and its +// ballast, a switch the trackbed made for it namespace track_blend { // how far from an end the textures blend, by default