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

feat(renderer): a matte variant of a material for the parts of rails no wheel rolls on: it lights the same maps as weathered steel, with the weathering scaled per vertex by userdata, so a polished running surface fades into unused steel without a bright stripe; the cut faces of rails are drawn in it in an extra pass

This commit is contained in:
maj00r
2026-10-13 18:30:16 +02:00
parent c7f9796387
commit 7e1b2c553c
7 changed files with 133 additions and 0 deletions

View File

@@ -3327,6 +3327,32 @@ opengl_renderer::Render( scene::basic_cell::path_sequence::const_iterator First,
}
}
}
// cut faces of rails
if( ( m_renderpass.draw_mode == rendermode::color )
|| ( m_renderpass.draw_mode == rendermode::reflections ) ) {
for( auto first { First }; first != Last; ++first ) {
auto const track { *first };
if( false == track->m_visible ) {
continue;
}
for( auto const &cuts : { std::make_pair( track->m_materialcut1, &track->GeometryCut1 ), std::make_pair( track->m_materialcut2, &track->GeometryCut2 ) } ) {
if( ( cuts.first == null_handle )
|| ( cuts.second->empty() ) ) {
continue;
}
if( track->eEnvironment != e_flat ) {
setup_environment_light( track->eEnvironment );
}
Bind_Material( cuts.first );
m_geometry.draw( std::begin( *cuts.second ), std::end( *cuts.second ) );
if( track->eEnvironment != e_flat ) {
setup_environment_light();
}
}
}
}
// post-render reset
switch( m_renderpass.draw_mode ) {
case rendermode::shadows: