17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-23 12:26:06 +02:00

Simulate and light the smoke on the GPU and make rain and snow of particles

This commit is contained in:
2026-10-20 16:44:27 +02:00
parent 6a109e984c
commit 867497b658
22 changed files with 1637 additions and 13 deletions

View File

@@ -1556,6 +1556,33 @@ global_settings::ConfigParse_gfx( cParser &Parser, std::string_view const Token
Parser >> gfx_grass_density;
gfx_grass_density = std::clamp(gfx_grass_density, 0.f, 4.f);
}
else if (Token == "gfx.smoke.gpu")
{
Parser.getTokens(1);
Parser >> gfx_smoke_gpu;
}
else if (Token == "gfx.smoke.lighting")
{
Parser.getTokens(1);
Parser >> gfx_smoke_lighting;
}
else if (Token == "gfx.particles.soft")
{
Parser.getTokens(1);
Parser >> gfx_particles_soft;
gfx_particles_soft = std::clamp(gfx_particles_soft, 0.f, 4.f);
}
else if (Token == "gfx.precipitation.gpu")
{
Parser.getTokens(1);
Parser >> gfx_precipitation_gpu;
}
else if (Token == "gfx.precipitation.particles")
{
Parser.getTokens(1);
Parser >> gfx_precipitation_particles;
gfx_precipitation_particles = std::clamp(gfx_precipitation_particles, 0, 1 << 20);
}
else if (Token == "gfx.bufferstreaming")
{
Parser.getTokens(1);
@@ -2074,6 +2101,11 @@ global_settings::export_as_text( std::ostream &Output ) const {
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.smoke.gpu", gfx_smoke_gpu );
export_as_text( Output, "gfx.smoke.lighting", gfx_smoke_lighting );
export_as_text( Output, "gfx.particles.soft", gfx_particles_soft );
export_as_text( Output, "gfx.precipitation.gpu", gfx_precipitation_gpu );
export_as_text( Output, "gfx.precipitation.particles", gfx_precipitation_particles );
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

@@ -332,6 +332,17 @@ struct global_settings {
// (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 smoke is simulated and drawn on the gpu (opengl46_gpu_particles), lit by the sun, the sky and the lamps
// when gfx_smoke_lighting; false: simulated on the cpu and drawn as before
bool gfx_smoke_gpu = true;
bool gfx_smoke_lighting = true;
// (opengl 4.6) the particles of the gpu fade where they near what is behind them, over this share of their size (smoke) or of
// a few decimetres (rain, snow), instead of being cut by it; 0: cut, as before
float gfx_particles_soft = 1.f;
// (opengl 4.6) rain and snow as particles around the camera, lit like the smoke (opengl46_gpu_particles), at most this many of
// them in the heaviest rain or snow; false: the textured cylinder, as before
bool gfx_precipitation_gpu = true;
int gfx_precipitation_particles = 65536;
// (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;