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

feat(terrain): holes cut in the heightmap terrain and shader grass painted over it

This commit is contained in:
2026-10-20 01:32:01 +02:00
parent d7ba6926fc
commit f3bdadad66
32 changed files with 2020 additions and 30 deletions

View File

@@ -1528,6 +1528,23 @@ global_settings::ConfigParse_gfx( cParser &Parser, std::string_view const Token
Parser.getTokens(1);
Parser >> gfx_depthprepass_replay;
}
else if (Token == "gfx.grass")
{
Parser.getTokens(1);
Parser >> gfx_grass;
}
else if (Token == "gfx.grass.distance")
{
Parser.getTokens(1);
Parser >> gfx_grass_distance;
gfx_grass_distance = std::clamp(gfx_grass_distance, 5.f, 500.f);
}
else if (Token == "gfx.grass.density")
{
Parser.getTokens(1);
Parser >> gfx_grass_density;
gfx_grass_density = std::clamp(gfx_grass_density, 0.f, 4.f);
}
else if (Token == "gfx.bufferstreaming")
{
Parser.getTokens(1);
@@ -2041,6 +2058,9 @@ global_settings::export_as_text( std::ostream &Output ) const {
export_as_text( Output, "gfx.gpucull.models", gfx_gpucull_models );
export_as_text( Output, "gfx.depthprepass.scene", gfx_depthprepass_scene );
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.density", gfx_grass_density );
export_as_text( Output, "gfx.bufferstreaming", gfx_bufferstreaming );
export_as_text( Output, "gfx.postfx.motionblur.enabled", gfx_postfx_motionblur_enabled );
export_as_text( Output, "gfx.postfx.motionblur.shutter", gfx_postfx_motionblur_shutter );

View File

@@ -321,6 +321,11 @@ struct global_settings {
// the colour pass as well: its opaque draws are recorded once, their depth drawn from the record (with the contact shadows
// alone only within their reach) and their colour too. false: the scene is walked twice, as before
bool gfx_depthprepass_replay = true;
// (opengl 4.6) grass of the heightmap terrain, grown where it's painted: drawn, how far from the camera (metres), and how
// many blades of the density painted (1: all)
bool gfx_grass = true;
float gfx_grass_distance = 60.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
bool gfx_bufferstreaming = true;