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

build 200124. scenario parameters control sliders, material reload support, material opacity driven translucent geometry alpha test, command keyboard mapping tooltip hints, camshaft logic tweak, motor connector logic tweak, ai power use logic tweak, ai pantograph control logic tweak, converter sound pitch fix. additional cab control localization

This commit is contained in:
tmj-fstate
2020-01-24 17:25:57 +01:00
parent a501c09b0f
commit f14b2c1343
32 changed files with 709 additions and 279 deletions

View File

@@ -1597,9 +1597,14 @@ bool opengl33_renderer::Render(world_environment *Environment)
if (Environment->m_clouds.mdCloud)
{
// setup
glm::vec3 color = interpolate(Environment->m_skydome.GetAverageColor(), suncolor, duskfactor * 0.25f) * interpolate(1.f, 0.35f, Global.Overcast / 2.f) // overcast darkens the clouds
* 0.5f;
glm::vec3 color =
interpolate(
Environment->m_skydome.GetAverageColor(), suncolor,
duskfactor * 0.25f)
* interpolate(
1.f, 0.35f,
Global.Overcast / 2.f) // overcast darkens the clouds
* 0.5f;
// write cloud color into material
TSubModel *mdl = Environment->m_clouds.mdCloud->Root;
if (mdl->m_material != null_handle)
@@ -1751,17 +1756,18 @@ void opengl33_renderer::Bind_Material(material_handle const Material, TSubModel
model_ubs.param[entry.location][entry.offset + j] = src[j];
}
if (m_blendingenabled)
{
model_ubs.opacity = -1.0f;
}
else
{
if (!std::isnan(material.opacity))
model_ubs.opacity = material.opacity;
else
model_ubs.opacity = 0.5f;
}
if( !std::isnan( material.opacity ) ) {
model_ubs.opacity = (
m_blendingenabled ?
-material.opacity :
material.opacity );
}
else {
model_ubs.opacity = (
m_blendingenabled ?
0.0f :
0.5f );
}
if (sm)
model_ubs.alpha_mult = sm->fVisible;
@@ -3926,6 +3932,19 @@ void opengl33_renderer::Update(double const Deltatime)
}
}
// update resources if there was environmental change
simulation_state simulationstate {
Global.Weather,
Global.Season
};
std::swap( m_simulationstate, simulationstate );
if( ( m_simulationstate.season != simulationstate.season ) && ( false == simulationstate.season.empty() ) ) {
m_materials.on_season_change();
}
if( ( m_simulationstate.weather != simulationstate.weather ) && ( false == simulationstate.weather.empty() ) ) {
m_materials.on_weather_change();
}
if ((true == Global.ResourceSweep) && (true == simulation::is_ready))
{
// garbage collection