17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-02 22:06:21 +01:00

Shade the sky and the sun by the scenery around the camera instead of the track environment flags

This commit is contained in:
2026-10-27 16:02:36 +01:00
parent 9dde5b0e5e
commit 2a876befb0
35 changed files with 2351 additions and 55 deletions

View File

@@ -1918,6 +1918,19 @@ global_settings::ConfigParse_gfx_sky( cParser &Parser, std::string_view const To
gfx_cabprobe_interval = std::clamp( gfx_cabprobe_interval, 1, 120 ); }
else if( Token == "gfx.cabprobe.bounce" ) { readvalue( gfx_cabprobe_bounce, 0.f, 4.f ); }
else if( Token == "gfx.cabprobe.reflections" ) { readswitch( gfx_cabprobe_reflections ); }
else if( Token == "gfx.skyvisibility" ) {
// no/low/medium/high, or the number of the level
Parser.getTokens( 1 );
std::string level;
Parser >> level;
gfx_skyvisibility =
( level == "low" || level == "1" ) ? 1 :
( level == "medium" || level == "yes" || level == "true" || level == "2" ) ? 2 :
( level == "high" || level == "3" ) ? 3 :
0; }
else if( Token == "gfx.skyvisibility.sun" ) { readswitch( gfx_skyvisibility_sun ); }
else if( Token == "gfx.skyvisibility.fog" ) { readswitch( gfx_skyvisibility_fog ); }
else if( Token == "gfx.tunnelflags" ) { readswitch( gfx_tunnelflags ); }
else if( Token == "gfx.lights.range" ) { readvalue( gfx_lights_range, 0.f, 2000.f ); }
else if( Token == "gfx.lights.shadows" ) {
// no/low/medium/high, or the number of the level
@@ -2394,6 +2407,10 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "gfx.cabprobe.interval", gfx_cabprobe_interval );
export_as_text( Output, "gfx.cabprobe.bounce", gfx_cabprobe_bounce );
export_as_text( Output, "gfx.cabprobe.reflections", gfx_cabprobe_reflections );
export_as_text( Output, "gfx.skyvisibility", std::string{ gfx_skyvisibility == 3 ? "high" : gfx_skyvisibility == 2 ? "medium" : gfx_skyvisibility == 1 ? "low" : "no" } );
export_as_text( Output, "gfx.skyvisibility.sun", gfx_skyvisibility_sun );
export_as_text( Output, "gfx.skyvisibility.fog", gfx_skyvisibility_fog );
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.lamps", gfx_lights_shadows_lamps );

View File

@@ -497,6 +497,18 @@ struct global_settings {
int gfx_cabprobe_interval { 4 };
float gfx_cabprobe_bounce { 1.f };
bool gfx_cabprobe_reflections { true };
// the occlusion of the sky and of the sun by the scenery around the camera (opengl 4.6 and vulkan, gfx::sky_occlusion, the track T):
// tunnels, the ground under bridges and roofs, cuttings and the foot of slopes are dark by their geometry, worked out in the
// background from the scenery seen from above. 0 off (nothing is occluded), 1 low (256 m around the camera, texels of 1 m),
// 2 medium (512 m, 1 m), 3 high (512 m, 0.5 m, searched farther); whether the sun (the moon) is held back too, and the light of
// the volumetric fog
int gfx_skyvisibility { 2 };
bool gfx_skyvisibility_sun { true };
bool gfx_skyvisibility_fog { true };
// the environment flags of the tracks (tunnel, canyon) darken the tracks and the vehicles on them, as before the track T. off: the
// renderers leave them alone and the light comes from the geometry (gfx_skyvisibility); the flags stay in the scenery files for
// the sound and the driver
bool gfx_tunnelflags { false };
float gfx_lights_range { 300.f }; // distance from the camera the lights of models and vehicles are taken from, metres
// 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