mirror of
https://github.com/minetest/minetest.git
synced 2024-07-07 08:25:28 +02:00
Don't whiten mapblocks and entities if the ambient light color is grayscale
This commit is contained in:
parent
17a75185e1
commit
ff7ba2b7a1
@ -380,7 +380,8 @@ void main(void)
|
|||||||
color = base.rgb;
|
color = base.rgb;
|
||||||
vec4 col = vec4(color.rgb * varColor.rgb, 1.0);
|
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
|
#ifdef ENABLE_DYNAMIC_SHADOWS
|
||||||
if (f_shadow_strength > 0.0) {
|
if (f_shadow_strength > 0.0) {
|
||||||
|
@ -382,7 +382,8 @@ void main(void)
|
|||||||
|
|
||||||
color = base.rgb;
|
color = base.rgb;
|
||||||
vec4 col = vec4(color.rgb * varColor.rgb, 1.0);
|
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;
|
col.rgb *= vIDiff;
|
||||||
|
|
||||||
#ifdef ENABLE_DYNAMIC_SHADOWS
|
#ifdef ENABLE_DYNAMIC_SHADOWS
|
||||||
|
@ -262,7 +262,7 @@ void ClientEnvironment::step(float dtime)
|
|||||||
|
|
||||||
u16 light = getInteriorLight(node_at_lplayer, 0, m_client->ndef());
|
u16 light = getInteriorLight(node_at_lplayer, 0, m_client->ndef());
|
||||||
lplayer->light_color = encode_light(light, 0,
|
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);
|
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.
|
// based on the entity glow.
|
||||||
if (m_enable_shaders)
|
if (m_enable_shaders)
|
||||||
light = encode_light(light_at_pos, m_prop.glow,
|
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
|
else
|
||||||
final_color_blend(&light, light_at_pos, day_night_ratio);
|
final_color_blend(&light, light_at_pos, day_night_ratio);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user