17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-02 12:49:13 +01:00

Steady the volumetric fog and add a switch for the old headlight beams

This commit is contained in:
2026-10-16 23:23:51 +02:00
parent 8b929fc1da
commit 6ee628aaa5
9 changed files with 114 additions and 32 deletions

View File

@@ -1613,6 +1613,7 @@ global_settings::ConfigParse_gfx_sky( cParser &Parser, std::string_view const To
gfx_postfx_ao_steps = std::clamp( gfx_postfx_ao_steps, 1, 16 ); }
else if( Token == "gfx.lights.scenery" ) { readswitch( gfx_lights_scenery ); }
else if( Token == "gfx.lights.vehicles" ) { readswitch( gfx_lights_vehicles ); }
else if( Token == "gfx.lights.headlights" ) { readswitch( gfx_lights_headlights ); }
else if( Token == "gfx.lights.cab" ) { readswitch( gfx_lights_cab ); }
else if( Token == "gfx.lights.freespot.intensity" ) { readvalue( gfx_lights_freespot_intensity, 0.f, 1000.f ); }
else if( Token == "gfx.lights.compartment.intensity" ) { readvalue( gfx_lights_compartment_intensity, 0.f, 100.f ); }
@@ -1659,6 +1660,7 @@ global_settings::ConfigParse_gfx_sky( cParser &Parser, std::string_view const To
else if( Token == "gfx.fog.lights" ) { readvalue( gfx_fog_lights, 0.f, 10.f ); }
else if( Token == "gfx.fog.shadows" ) { readswitch( gfx_fog_shadows ); }
else if( Token == "gfx.fog.temporal" ) { readswitch( gfx_fog_temporal ); }
else if( Token == "gfx.fog.temporal.share" ) { readvalue( gfx_fog_temporal_share, 0.02f, 1.f ); }
else if( Token == "gfx.clouds" ) {
// no, or the quality: low, medium (yes), high, ultra
Parser.getTokens( 1 );
@@ -1950,6 +1952,7 @@ global_settings::export_as_text( std::ostream &Output ) const {
Output << "gfx.postfx.ao.quality " << gfx_postfx_ao_slices << " " << gfx_postfx_ao_steps << "\n";
export_as_text( Output, "gfx.lights.scenery", gfx_lights_scenery );
export_as_text( Output, "gfx.lights.vehicles", gfx_lights_vehicles );
export_as_text( Output, "gfx.lights.headlights", gfx_lights_headlights );
export_as_text( Output, "gfx.lights.cab", gfx_lights_cab );
export_as_text( Output, "gfx.lights.freespot.intensity", gfx_lights_freespot_intensity );
export_as_text( Output, "gfx.lights.compartment.intensity", gfx_lights_compartment_intensity );
@@ -1969,6 +1972,7 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "gfx.fog.lights", gfx_fog_lights );
export_as_text( Output, "gfx.fog.shadows", gfx_fog_shadows );
export_as_text( Output, "gfx.fog.temporal", gfx_fog_temporal );
export_as_text( Output, "gfx.fog.temporal.share", gfx_fog_temporal_share );
export_as_text( Output, "gfx.clouds", std::string{ gfx_clouds == 1 ? "low" : gfx_clouds == 2 ? "medium" : gfx_clouds == 3 ? "high" : gfx_clouds == 4 ? "ultra" : "no" } );
export_as_text( Output, "gfx.clouds.distance", gfx_clouds_distance );
export_as_text( Output, "gfx.clouds.shadows", gfx_clouds_shadows );

View File

@@ -341,6 +341,9 @@ struct global_settings {
// they go through the light clusters, so they need gfx_lights_clustered
bool gfx_lights_scenery { true }; // light points (freespot lights) of scenery models light their surroundings
bool gfx_lights_vehicles { true }; // light points of vehicles and their lit compartments light their surroundings
// the old lighting ahead of vehicles: the beam of their headlights (light_array, the projected texture of the beam), with its
// shadows and its light in the fog. off: the vehicles light what is ahead of them only with the light points of their lamps
bool gfx_lights_headlights { true };
bool gfx_lights_cab { true }; // the lamp of the occupied cab is a point light instead of an addition to the ambient light
float gfx_lights_freespot_intensity { 10.f }; // brightness of a light point of a model
float gfx_lights_compartment_intensity { 1.f }; // brightness of the light of a lit vehicle compartment
@@ -366,13 +369,15 @@ struct global_settings {
// environment/weather.h. fog: 1 volumetric (a volume over the view with the shafts of the sun, the shadows of the clouds and
// the light of lamps and headlights, worked out along the ray past it), 0 analytic (the same fog along the ray only, the way
// the old one was drawn); the quality of the volume 1-4 (low, medium, high, ultra), its depth (metres), the brightness of the
// lamps in it (0: none), whether the sun and the headlights cast their shadows into it, blending over frames
// lamps in it (0: none), whether the sun and the headlights cast their shadows into it, blending over frames and the share of
// a new frame in the blend (lower: smoother, but the light of moving lamps lags more behind them)
int gfx_fog { 1 };
int gfx_fog_quality { 2 };
float gfx_fog_range { 1500.f };
float gfx_fog_lights { 1.f };
bool gfx_fog_shadows { true };
bool gfx_fog_temporal { true };
float gfx_fog_temporal_share { 0.1f };
// volumetric clouds, 0 none, 1-4 the quality (low, medium, high, ultra); the farthest they are drawn (metres); the shadows
// they cast (a map around the camera: its size in texels and in metres)
int gfx_clouds { 2 };