1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Improve ergonomics of CachedShaderSetting

This commit is contained in:
sfan5 2024-02-20 14:59:47 +01:00
parent e9ab5bc223
commit 0c3a4cc7b9
4 changed files with 75 additions and 47 deletions

View file

@ -32,9 +32,7 @@ void ShadowConstantSetter::onSetConstants(video::IMaterialRendererServices *serv
shadowViewProj *= light.getViewMatrix();
m_shadow_view_proj.set(shadowViewProj.pointer(), services);
f32 v_LightDirection[3];
light.getDirection().getAs3Values(v_LightDirection);
m_light_direction.set(v_LightDirection, services);
m_light_direction.set(light.getDirection(), services);
f32 TextureResolution = light.getMapResolution();
m_texture_res.set(&TextureResolution, services);
@ -79,7 +77,7 @@ void ShadowDepthShaderCB::OnSetConstants(
lightMVP *= driver->getTransform(video::ETS_WORLD);
m_light_mvp_setting.set(lightMVP.pointer(), services);
m_light_mvp_setting.set(lightMVP, services);
m_map_resolution_setting.set(&MapRes, services);
m_max_far_setting.set(&MaxFar, services);
s32 TextureId = 0;