+
+ // Set uniforms for Shadow shader
+ if (ShadowRenderer *shadow = RenderingEngine::get_shadow_renderer()) {
+ const auto &light = shadow->getDirectionalLight();
+
+ core::matrix4 shadowViewProj = light.getProjectionMatrix();
+ shadowViewProj *= light.getViewMatrix();
+ m_shadow_view_proj.set(shadowViewProj.pointer(), services);
+
+ float v_LightDirection[3];
+ light.getDirection().getAs3Values(v_LightDirection);
+ m_light_direction.set(v_LightDirection, services);
+
+ float TextureResolution = light.getMapResolution();
+ m_texture_res.set(&TextureResolution, services);
+
+ float ShadowStrength = shadow->getShadowStrength();
+ m_shadow_strength.set(&ShadowStrength, services);
+
+ float timeOfDay = shadow->getTimeOfDay();
+ m_time_of_day.set(&timeOfDay, services);
+
+ float shadowFar = shadow->getMaxShadowFar();
+ m_shadowfar.set(&shadowFar, services);
+
+ // I dont like using this hardcoded value. maybe something like
+ // MAX_TEXTURE - 1 or somthing like that??
+ s32 TextureLayerID = 3;
+ m_shadow_texture.set(&TextureLayerID, services);
+ }