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

Light the cab with cablight/dashboardlight light points of the cab model

This commit is contained in:
2026-10-28 20:55:45 +01:00
parent 8f891fdc14
commit 9904eddd0d
22 changed files with 512 additions and 214 deletions

View File

@@ -1972,6 +1972,10 @@ global_settings::ConfigParse_gfx_sky( cParser &Parser, std::string_view const To
( level == "medium" || level == "yes" || level == "true" || level == "2" ) ? 2 :
( level == "high" || level == "3" ) ? 3 :
0; }
else if( Token == "gfx.lights.shadows.cab" ) {
Parser.getTokens( 1 );
Parser >> gfx_lights_shadows_cab;
gfx_lights_shadows_cab = std::clamp( gfx_lights_shadows_cab, 0, 8 ); }
else if( Token == "gfx.lights.shadows.lamps" ) {
Parser.getTokens( 1 );
Parser >> gfx_lights_shadows_lamps;
@@ -2453,6 +2457,7 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "gfx.tunnelflags", gfx_tunnelflags );
export_as_text( Output, "gfx.lights.range", gfx_lights_range );
export_as_text( Output, "gfx.lights.shadows", std::string{ gfx_lights_shadows == 3 ? "high" : gfx_lights_shadows == 2 ? "medium" : gfx_lights_shadows == 1 ? "low" : "no" } );
export_as_text( Output, "gfx.lights.shadows.cab", gfx_lights_shadows_cab );
export_as_text( Output, "gfx.lights.shadows.lamps", gfx_lights_shadows_lamps );
export_as_text( Output, "gfx.lights.shadows.lamps.size", gfx_lights_shadows_lamps_size );
export_as_text( Output, "gfx.lights.shadows.lamps.range", gfx_lights_shadows_lamps_range );

View File

@@ -538,6 +538,9 @@ struct global_settings {
// shadows of the lamps (cube shadow maps), 0 none, 1 low, 2 medium, 3 high; see opengl46_local_shadows. for now the lamp of the
// occupied cab, its shadows cast by the cab
int gfx_lights_shadows { 2 };
// with gfx_lights_shadows above 0: how many lights of the occupied cab (its lamps, the lights of its desk) at most have shadows
// cast by the cab, the brightest ones (0-8)
int gfx_lights_shadows_cab { 4 };
// shadows of the lamps of scenery models (cube maps of the scenery around them, kept; vehicles added as they pass), with
// gfx_lights_shadows above 0: how many lamps at once, the size of a face of their maps, the distance from the camera within
// which lamps get shadows and within which vehicles (and the cab) cast them