1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-23 12:45:43 +02:00

Improve lighting of entities.

Pass correct natural & artificial light to the shaders
Use natural/artificial light ratio for correct rendering of shadows
This commit is contained in:
Dmitry Kostenko
2021-11-04 03:03:10 +01:00
committed by x2048
parent f2cccf8da7
commit 54dccc480e
5 changed files with 50 additions and 25 deletions

View File

@@ -125,7 +125,7 @@ private:
std::string m_current_texture_modifier = "";
bool m_visuals_expired = false;
float m_step_distance_counter = 0.0f;
u8 m_last_light = 255;
video::SColor m_last_light = video::SColor(0xFFFFFFFF);
bool m_is_visible = false;
s8 m_glow = 0;
// Material
@@ -245,7 +245,7 @@ public:
void updateLight(u32 day_night_ratio);
void setNodeLight(u8 light);
void setNodeLight(const video::SColor &light);
/* Get light position(s).
* returns number of positions written into pos[], which must have space