17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-06 16:18:35 +01:00

Fit the cascades of the sun shadows to the depth of the view

This commit is contained in:
2026-10-19 12:02:01 +02:00
parent e7c65993d8
commit 8c00b0bc3d
13 changed files with 857 additions and 21 deletions

View File

@@ -1607,6 +1607,17 @@ global_settings::ConfigParse_gfx( cParser &Parser, std::string_view const Token
Parser >> gfx_shadow_rank_cutoff;
gfx_shadow_rank_cutoff = std::clamp(gfx_shadow_rank_cutoff, 1, 3);
}
else if (Token == "gfx.shadow.sdsm")
{
Parser.getTokens(1);
Parser >> gfx_shadow_sdsm;
}
else if (Token == "gfx.shadow.sdsm.split")
{
Parser.getTokens(1);
Parser >> gfx_shadow_sdsm_split;
gfx_shadow_sdsm_split = std::clamp(gfx_shadow_sdsm_split, 0.f, 1.f);
}
else if (ConfigParse_gfx_sky(Parser, Token))
{
// parsed
@@ -2006,6 +2017,8 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "gfx.shadergamma", gfx_shadergamma );
export_as_text( Output, "gfx.shadow.angle.min", gfx_shadow_angle_min );
export_as_text( Output, "gfx.shadow.rank.cutoff", gfx_shadow_rank_cutoff );
export_as_text( Output, "gfx.shadow.sdsm", gfx_shadow_sdsm );
export_as_text( Output, "gfx.shadow.sdsm.split", gfx_shadow_sdsm_split );
export_as_text( Output, "gfx.ambient.sh", gfx_ambient_sh );
export_as_text( Output, "gfx.ambient.sh.strength", gfx_ambient_sh_strength );
export_as_text( Output, "gfx.ambient.groundalbedo", gfx_ambient_groundalbedo );

View File

@@ -334,6 +334,13 @@ struct global_settings {
float gfx_distance_factor_max { 3.f };
float gfx_shadow_angle_min { -0.2f };
int gfx_shadow_rank_cutoff { 3 };
// (opengl 4.6) the cascades of the sun shadows are fitted to the depth of the main view of a frame or two before (SDSM):
// the distances they cover go from the nearest to the farthest pixel which isn't the sky, and the map of each covers only
// the area of the pixels it takes. false: the fixed cascades of shadowtune
bool gfx_shadow_sdsm { false };
// with gfx_shadow_sdsm: how the distances between the nearest and the farthest pixel are split between the cascades,
// 0: in equal lengths, 1: in equal ratios
float gfx_shadow_sdsm_split { 0.9f };
// sky light and exposure of the opengl 4.6 renderer. the switches can also be changed at run time in the debug window
// "Sky and exposure"; the scales are multipliers of the calibrated defaults (1 = as calibrated)