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

feat(terrain): grass follows the seasons and fades out over gfx.grass.fadedistance

This commit is contained in:
2026-10-20 02:20:03 +02:00
parent ceb439b218
commit 07ac7406a0
13 changed files with 129 additions and 28 deletions

View File

@@ -1539,6 +1539,12 @@ global_settings::ConfigParse_gfx( cParser &Parser, std::string_view const Token
Parser >> gfx_grass_distance;
gfx_grass_distance = std::clamp(gfx_grass_distance, 5.f, 500.f);
}
else if (Token == "gfx.grass.fadedistance")
{
Parser.getTokens(1);
Parser >> gfx_grass_fadedistance;
gfx_grass_fadedistance = std::clamp(gfx_grass_fadedistance, 5.f, 600.f);
}
else if (Token == "gfx.grass.density")
{
Parser.getTokens(1);
@@ -2060,6 +2066,7 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "gfx.depthprepass.replay", gfx_depthprepass_replay );
export_as_text( Output, "gfx.grass", gfx_grass );
export_as_text( Output, "gfx.grass.distance", gfx_grass_distance );
export_as_text( Output, "gfx.grass.fadedistance", gfx_grass_fadedistance );
export_as_text( Output, "gfx.grass.density", gfx_grass_density );
export_as_text( Output, "gfx.bufferstreaming", gfx_bufferstreaming );
export_as_text( Output, "gfx.postfx.motionblur.enabled", gfx_postfx_motionblur_enabled );

View File

@@ -325,6 +325,8 @@ struct global_settings {
// many blades of the density painted (1: all)
bool gfx_grass = true;
float gfx_grass_distance = 60.f;
// (opengl 4.6) the grass thins out from gfx_grass_distance to here, where it ends
float gfx_grass_fadedistance = 70.f;
float gfx_grass_density = 1.f;
// (opengl 4.6) the model block of every draw and the matrices of instances are written to persistently mapped buffers,
// one for each of the last frames, instead of with glBufferSubData. read at the start