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

Merge branch 'master' into feat/renderers-cleanup

This commit is contained in:
2026-11-07 16:44:51 +01:00
177 changed files with 11657 additions and 833 deletions

View File

@@ -188,9 +188,8 @@ world_environment::update() {
// the impact of sun component is reduced proportionally to overcast level, as overcast increases role of ambient light
auto const diffuselevel = std::lerp( keylightintensity, intensity * ( 1.0f - twilightfactor ), 1.0f - std::min( 1.f, Global.Overcast ) * 0.75f );
// ...update light colours and intensity.
keylightcolor = keylightcolor * diffuselevel;
Global.DayLight.diffuse = glm::vec4( keylightcolor, Global.DayLight.diffuse.a );
Global.DayLight.specular = glm::vec4( keylightcolor * 0.85f, diffuselevel );
Global.DayLight.diffuse = glm::vec4( keylightcolor * diffuselevel, Global.DayLight.diffuse.a );
Global.DayLight.specular = glm::vec4( keylightcolor * diffuselevel * 0.85f, diffuselevel );
// tonal impact of skydome color is inversely proportional to how high the sun is above the horizon
// (this is pure conjecture, aimed more to 'look right' than be accurate)

View File

@@ -37,6 +37,7 @@ http://mozilla.org/MPL/2.0/.
#include "utilities/utilities.h"
#include "editor/editorTerrainStreamer.hpp"
#include <format>
namespace simulation {
@@ -569,7 +570,14 @@ state_serializer::deserialize_node( cParser &Input, scene::scratch_data &Scratch
}
else if( nodedata.type == "track" ) {
auto *path { deserialize_path( Input, Scratchpad, nodedata ) };
std::unique_ptr<TTrack> made { deserialize_path( Input, Scratchpad, nodedata ) };
if( made->eType == tt_Unknown ) {
// with no path made it can't be joined nor drawn, and nothing could run on it: it goes with its holder
ErrorLog( std::format( "Bad scenario: track \"{}\" of an unknown type defined in file \"{}\" (line {}) left out", made->name(), Input.Name(), inputline ) );
return;
}
// from here on the scene owns it
auto *path { made.release() };
// duplicates of named tracks are currently experimentally allowed
if( false == simulation::Paths.insert( path ) ) {
ErrorLog( "Bad scenario: duplicate track name \"" + path->name() + "\" defined in file \"" + Input.Name() + "\" (line " + std::to_string( inputline ) + ")" );