17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 05:09:20 +02:00

fix(render): dark parts of a cab and of the running gear are no longer crushed to black, as the AgX look raises its contrast power from 1.0 in the shadows up to 1.6 only from the middle tones on, which keeps the bright tones, the outside view and the night as they were but leaves black knobs, levers and lettering visible on a black desk; the light of a cab can be scaled with gfx.cab.ambient, 1.0 by default

This commit is contained in:
maj00r
2026-10-14 16:55:43 +02:00
parent 20cf81b362
commit 000b8656cc
4 changed files with 10 additions and 1 deletions

View File

@@ -3939,6 +3939,8 @@ bool opengl33_renderer::Render_cab(TDynamicObject const *Dynamic, float const Li
}
auto const old_ambient { light_ubs.ambient };
light_ubs.ambient *= Global.gfx_cab_ambient;
light_ubo->update( light_ubs );
auto const luminance { Global.fLuminance * ( Dynamic->fShade > 0.0f ? Dynamic->fShade : 1.0f ) };
if( Lightlevel > 0.f ) {
// crude way to light the cabin, until we have something more complete in place

View File

@@ -109,7 +109,7 @@ vec3 AgxLook(vec3 val)
vec3 offset = vec3(0.0);
vec3 slope = vec3(1.0);
vec3 power = vec3(1.6);
vec3 power = mix(vec3(1.0), vec3(1.6), smoothstep(0.0, 0.4, luma));
float sat = 0.9;
#if AGX_LOOK == 1

View File

@@ -1335,6 +1335,11 @@ global_settings::ConfigParse_gfx( cParser &Parser, std::string_view const Token
Parser.getTokens();
Parser >> RenderCabShadowsRange;
}
else if (Token == "gfx.cab.ambient")
{
Parser.getTokens();
Parser >> gfx_cab_ambient;
}
else if (Token == "gfx.smoke")
{
// smoke visualization toggle
@@ -1600,6 +1605,7 @@ global_settings::export_as_text( std::ostream &Output ) const {
<< shadowtune.range << " "
<< 0 << "\n";
export_as_text( Output, "gfx.shadows.cab.range", RenderCabShadowsRange );
export_as_text( Output, "gfx.cab.ambient", gfx_cab_ambient );
export_as_text( Output, "gfx.smoke", Smoke );
export_as_text( Output, "gfx.smoke.fidelity", SmokeFidelity );
export_as_text( Output, "smoothtraction", bSmoothTraction );

View File

@@ -159,6 +159,7 @@ struct global_settings {
bool RenderShadows{ true };
bool applicationQuitOrder{false};
int RenderCabShadowsRange{ 0 };
float gfx_cab_ambient{ 1.0f };
struct shadowtune_t {
unsigned int map_size{ 2048 };
float range{ 250.f };