diff options
| author | x2048 <codeforsmile@gmail.com> | 2022-11-23 22:40:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-23 22:40:26 +0100 |
| commit | 1c10988d6a19b06ac9c64e83675a76dea29cad2e (patch) | |
| tree | a17b55a714906971265324e20d275f954762904a | |
| parent | 9527cc3fa081ded4280765b6d805bf1bcc6591b9 (diff) | |
| download | minetest-1c10988d6a19b06ac9c64e83675a76dea29cad2e.tar.xz | |
Fix entity visiblity in bright artificial light (#12906)
| -rw-r--r-- | src/client/content_cao.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp index c43ca8696..255eff52a 100644 --- a/src/client/content_cao.cpp +++ b/src/client/content_cao.cpp @@ -883,10 +883,14 @@ void GenericCAO::updateLight(u32 day_night_ratio) if (!pos_ok) light_at_pos = LIGHT_SUN; + // Initialize with full alpha, otherwise entity won't be visible + video::SColor light{0xFFFFFFFF}; + // Encode light into color, adding a small boost // based on the entity glow. - video::SColor light = encode_light(light_at_pos, m_prop.glow); - if (!m_enable_shaders) + if (m_enable_shaders) + light = encode_light(light_at_pos, m_prop.glow); + else final_color_blend(&light, light_at_pos, day_night_ratio); if (light != m_last_light) { |
