From 6b87fe43b303a6b93aa1a5a7d05242b5d9444edb Mon Sep 17 00:00:00 2001 From: Hirek193 Date: Wed, 21 Oct 2026 22:52:59 +0200 Subject: [PATCH] chore(track): log why a material isn't blended at the joints of the tracks --- model/material.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/model/material.cpp b/model/material.cpp index 05e829a7..3b2fe7eb 100644 --- a/model/material.cpp +++ b/model/material.cpp @@ -791,6 +791,21 @@ material_manager::blendable( material_handle const Material ) { ErrorLog( "invalid shader: " + std::string( e.what() ) ); } } + if( false == result ) { + // once for each material a track would blend, which of the conditions it fails + std::string textures; + if( material.shader ) { + for( auto const &entry : material.shader->texture_conf ) { + textures += ( textures.empty() ? "" : ", " ) + entry.first; + } + } + WriteLog( + "track blend: material \"" + material.name + "\" isn't blended:" + + ( material.is_good ? "" : " not good;" ) + + ( material.shader ? " a shader with the textures " + textures + ";" : " no shader;" ) + + ( material.texture_variants.empty() ? "" : " texture variants;" ) + + ( material.update_on_weather_change || material.update_on_season_change ? " changes with the weather or seasons;" : "" ) ); + } m_blendables.emplace( Material, result ); return result; }