aboutsummaryrefslogtreecommitdiff
path: root/src/client/shadows/dynamicshadowsrender.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/shadows/dynamicshadowsrender.cpp')
-rw-r--r--src/client/shadows/dynamicshadowsrender.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/client/shadows/dynamicshadowsrender.cpp b/src/client/shadows/dynamicshadowsrender.cpp
index 262711221..1dfc90d1c 100644
--- a/src/client/shadows/dynamicshadowsrender.cpp
+++ b/src/client/shadows/dynamicshadowsrender.cpp
@@ -158,7 +158,6 @@ void ShadowRenderer::setShadowIntensity(float shadow_intensity)
disable();
}
-
void ShadowRenderer::addNodeToShadowList(
scene::ISceneNode *node, E_SHADOW_MODE shadowMode)
{
@@ -261,8 +260,9 @@ void ShadowRenderer::updateSMTextures()
cb->MaxFar = (f32)m_shadow_map_max_distance * BS;
cb->PerspectiveBiasXY = getPerspectiveBiasXY();
cb->PerspectiveBiasZ = getPerspectiveBiasZ();
+ cb->CameraPos = light.getFuturePlayerPos();
}
-
+
// set the Render Target
// right now we can only render in usual RTT, not
// Depth texture is available in irrlicth maybe we
@@ -322,9 +322,10 @@ void ShadowRenderer::update(video::ITexture *outputTarget)
if (!m_shadow_node_array.empty() && !m_light_list.empty()) {
for (DirectionalLight &light : m_light_list) {
- // Static shader values.
- m_shadow_depth_cb->MapRes = (f32)m_shadow_map_texture_size;
- m_shadow_depth_cb->MaxFar = (f32)m_shadow_map_max_distance * BS;
+ // Static shader values for entities are set in updateSMTextures
+ // SM texture for entities is not updated incrementally and
+ // must by updated using current player position.
+ m_shadow_depth_entity_cb->CameraPos = light.getPlayerPos();
// render shadows for the n0n-map objects.
m_driver->setRenderTarget(shadowMapTextureDynamicObjects, true,