1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add artificial light control

This commit is contained in:
Gefüllte Taubenbrust 2024-05-09 18:38:29 +02:00
parent dd475d8af4
commit ded1b09838
8 changed files with 24 additions and 4 deletions

View file

@ -381,6 +381,7 @@ class GameGlobalShaderConstantSetter : public IShaderConstantSetter
m_animation_timer_delta_vertex{"animationTimerDelta"};
CachedPixelShaderSetting<float>
m_animation_timer_delta_pixel{"animationTimerDelta"};
CachedPixelShaderSetting<float, 3> m_artificial_light{ "artificialLight" };
CachedPixelShaderSetting<float, 3> m_day_light{"dayLight"};
CachedPixelShaderSetting<float, 3> m_minimap_yaw{"yawVec"};
CachedPixelShaderSetting<float, 3> m_camera_offset_pixel{"cameraOffset"};
@ -525,6 +526,8 @@ public:
const auto &lighting = m_client->getEnv().getLocalPlayer()->getLighting();
float saturation = lighting.saturation;
m_saturation_pixel.set(&saturation, services);
video::SColorf artificial_light = lighting.artificial_light_color;
m_artificial_light.set(artificial_light, services);
if (m_volumetric_light_enabled) {
// Map directional light to screen space