mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-05 16:52:31 +01:00
Add screen-space contact shadows for the sun, lamps and headlights
This commit is contained in:
@@ -1655,6 +1655,18 @@ global_settings::ConfigParse_gfx_sky( cParser &Parser, std::string_view const To
|
||||
Parser >> gfx_lights_shadows_headlights;
|
||||
gfx_lights_shadows_headlights = std::clamp( gfx_lights_shadows_headlights, 0, 4 ); }
|
||||
else if( Token == "gfx.lights.shadows.headlights.range" ) { readvalue( gfx_lights_shadows_headlights_range, 10.f, 1000.f ); }
|
||||
else if( Token == "gfx.contactshadows" ) {
|
||||
// no/low/medium/high, or the number of the level
|
||||
Parser.getTokens( 1 );
|
||||
std::string level;
|
||||
Parser >> level;
|
||||
gfx_contactshadows =
|
||||
( level == "low" || level == "1" ) ? 1 :
|
||||
( level == "medium" || level == "yes" || level == "true" || level == "2" ) ? 2 :
|
||||
( level == "high" || level == "3" ) ? 3 :
|
||||
0; }
|
||||
else if( Token == "gfx.contactshadows.length" ) { readvalue( gfx_contactshadows_length, 0.05f, 5.f ); }
|
||||
else if( Token == "gfx.contactshadows.range" ) { readvalue( gfx_contactshadows_range, 1.f, 1000.f ); }
|
||||
else if( Token == "gfx.fog" ) {
|
||||
// volumetric (yes) or analytic (no, old): the same weather either way
|
||||
Parser.getTokens( 1 );
|
||||
@@ -1978,6 +1990,9 @@ global_settings::export_as_text( std::ostream &Output ) const {
|
||||
export_as_text( Output, "gfx.lights.shadows.vehicles.range", gfx_lights_shadows_vehicles_range );
|
||||
export_as_text( Output, "gfx.lights.shadows.headlights", gfx_lights_shadows_headlights );
|
||||
export_as_text( Output, "gfx.lights.shadows.headlights.range", gfx_lights_shadows_headlights_range );
|
||||
export_as_text( Output, "gfx.contactshadows", std::string{ gfx_contactshadows == 3 ? "high" : gfx_contactshadows == 2 ? "medium" : gfx_contactshadows == 1 ? "low" : "no" } );
|
||||
export_as_text( Output, "gfx.contactshadows.length", gfx_contactshadows_length );
|
||||
export_as_text( Output, "gfx.contactshadows.range", gfx_contactshadows_range );
|
||||
export_as_text( Output, "gfx.fog", std::string{ gfx_fog == 1 ? "volumetric" : "analytic" } );
|
||||
export_as_text( Output, "gfx.fog.quality", std::string{ gfx_fog_quality == 1 ? "low" : gfx_fog_quality == 3 ? "high" : gfx_fog_quality == 4 ? "ultra" : "medium" } );
|
||||
export_as_text( Output, "gfx.fog.range", gfx_fog_range );
|
||||
|
||||
@@ -370,6 +370,12 @@ struct global_settings {
|
||||
// cast them, metres
|
||||
int gfx_lights_shadows_headlights { 2 };
|
||||
float gfx_lights_shadows_headlights_range { 250.f };
|
||||
// (opengl 4.6) contact shadows: short rays through the depth of the scene drawn before its colour (which they turn on, see
|
||||
// gfx_depthprepass_scene) towards the sun and the nearest lamps. 0 none, 1 low (the sun), 2 medium (and 2 lamps), 3 high
|
||||
// (and 4 lamps, more steps); the length of the rays and the distance from the camera within which they are traced, metres
|
||||
int gfx_contactshadows { 0 };
|
||||
float gfx_contactshadows_length { 0.5f };
|
||||
float gfx_contactshadows_range { 50.f };
|
||||
// weather of the opengl 4.6 renderer (debug window "Weather"); the weather itself comes from the scenery, see
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user