From 660151572fdf848ee8416eea480df42a3b317df4 Mon Sep 17 00:00:00 2001 From: Rising Leaf <85687254+RisingLeaf@users.noreply.github.com> Date: Sat, 26 Aug 2023 20:12:17 +0200 Subject: [PATCH] Do not render objects that are invisble into the shadow map --- src/client/shadows/dynamicshadowsrender.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/shadows/dynamicshadowsrender.cpp b/src/client/shadows/dynamicshadowsrender.cpp index e2e5f86d0..ce3fdfc6d 100644 --- a/src/client/shadows/dynamicshadowsrender.cpp +++ b/src/client/shadows/dynamicshadowsrender.cpp @@ -474,8 +474,8 @@ void ShadowRenderer::renderShadowObjects( m_driver->setTransform(video::ETS_PROJECTION, light.getProjectionMatrix()); for (const auto &shadow_node : m_shadow_node_array) { - // we only take care of the shadow casters - if (shadow_node.shadowMode == ESM_RECEIVE) + // we only take care of the shadow casters and only visible nodes cast shadows + if (shadow_node.shadowMode == ESM_RECEIVE || !shadow_node.node->isVisible()) continue; // render other objects