Don't whiten mapblocks and entities if the ambient light color is grayscale

This commit is contained in:
Andrey2470T 2024-02-07 01:11:01 +03:00
parent 17a75185e1
commit ff7ba2b7a1
4 changed files with 6 additions and 4 deletions

@ -380,7 +380,8 @@ void main(void)
color = base.rgb;
vec4 col = vec4(color.rgb * varColor.rgb, 1.0);
col.rgb += ambientLight * ambientColor.rgb;
if (!(ambientColor.r == ambientColor.g && ambientColor.r == ambientColor.b))
col.rgb += ambientLight * ambientColor.rgb;
#ifdef ENABLE_DYNAMIC_SHADOWS
if (f_shadow_strength > 0.0) {

@ -382,7 +382,8 @@ void main(void)
color = base.rgb;
vec4 col = vec4(color.rgb * varColor.rgb, 1.0);
col.rgb += ambientLight * ambientColor.rgb;
if (!(ambientColor.r == ambientColor.g && ambientColor.r == ambientColor.b))
col.rgb += ambientLight * ambientColor.rgb;
col.rgb *= vIDiff;
#ifdef ENABLE_DYNAMIC_SHADOWS

@ -262,7 +262,7 @@ void ClientEnvironment::step(float dtime)
u16 light = getInteriorLight(node_at_lplayer, 0, m_client->ndef());
lplayer->light_color = encode_light(light, 0,
m_client->getEnv().getLocalPlayer()->getLighting().ambient_light.luminance); // this transfers light.alpha
lplayer->getLighting().ambient_light.luminance); // this transfers light.alpha
final_color_blend(&lplayer->light_color, light, day_night_ratio);
}

@ -908,7 +908,7 @@ void GenericCAO::updateLight(u32 day_night_ratio)
// based on the entity glow.
if (m_enable_shaders)
light = encode_light(light_at_pos, m_prop.glow,
m_client->getEnv().getLocalPlayer()->getLighting().ambient_light.luminance);
m_env->getLocalPlayer()->getLighting().ambient_light.luminance);
else
final_color_blend(&light, light_at_pos, day_night_ratio);