17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 16:49:21 +02:00

Draw volumetric clouds, their shadows, a volumetric fog and catalogue stars from a new weather system in the GL 4.6 renderer

This commit is contained in:
2026-10-16 21:44:47 +02:00
parent d509775269
commit 2be85410ce
47 changed files with 5092 additions and 74 deletions

View File

@@ -64,6 +64,8 @@ state_serializer::deserialize_begin( std::string const &Scenariofile ) {
Region = new scene::basic_region();
simulation::State.init_scripting_interface();
// the weather section of the previous scenery doesn't carry over
simulation::Environment.weather().reset();
// NOTE: for the time being import from text format is a given, since we don't have full binary serialization
std::shared_ptr<deserializer_state> state =
@@ -134,6 +136,7 @@ state_serializer::deserialize_begin( std::string const &Scenariofile ) {
{ "test", &state_serializer::deserialize_test },
{ "time", &state_serializer::deserialize_time },
{ "trainset", &state_serializer::deserialize_trainset },
{ "weather", &state_serializer::deserialize_weather },
{ "terrain", &state_serializer::deserialize_terrain },
{ "heightmap_terrain", &state_serializer::deserialize_heightmapterrain },
{ "editorterrain", &state_serializer::deserialize_editorterrain },
@@ -1041,6 +1044,13 @@ state_serializer::deserialize_sky( cParser &Input, scene::scratch_data &Scratchp
skip_until( Input, "endsky" );
}
void
state_serializer::deserialize_weather( cParser &Input, scene::scratch_data &Scratchpad ) {
// clouds, fog and precipitation, see environment/weather.h. wins over the atmo section
simulation::Environment.weather().deserialize( Input );
}
void
state_serializer::deserialize_test( cParser &Input, scene::scratch_data &Scratchpad ) {
@@ -1925,7 +1935,7 @@ std::pair<int, int> state_serializer::preview_include(std::string const &Directi
static std::unordered_map<std::string, std::string> const statementends {
{ "event", "endevent" }, { "trainset", "endtrainset" }, { "isolated", "endisolated" }, { "area", "endarea" }, { "assignment", "endassignment" },
{ "atmo", "endatmo" }, { "camera", "endcamera" }, { "config", "endconfig" }, { "description", "enddescription" }, { "light", "endlight" },
{ "sky", "endsky" }, { "test", "endtest" }, { "time", "endtime" }, { "terrain", "endterrain" }, { "heightmap_terrain", "endheightmap_terrain" }, { "editorterrain", "endeditorterrain" } };
{ "sky", "endsky" }, { "weather", "endweather" }, { "test", "endtest" }, { "time", "endtime" }, { "terrain", "endterrain" }, { "heightmap_terrain", "endheightmap_terrain" }, { "editorterrain", "endeditorterrain" } };
cParser parser(Directive, cParser::buffer_TEXT, Global.asCurrentSceneryPath, Global.bLoadTraction);
// the template is processed with the placement its directive is going to be loaded with