17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-03 10:50:22 +01:00

refactor(track): the ballast fades into that of the tracks joined, as the rails do

This commit is contained in:
2026-10-21 23:36:03 +02:00
parent b8eb5c71a1
commit 925f5910bb
18 changed files with 32 additions and 166 deletions

View File

@@ -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 {};

View File

@@ -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