Skip to content

Commit

Permalink
Do not render objects that are invisble into the shadow map
Browse files Browse the repository at this point in the history
  • Loading branch information
RisingLeaf committed Aug 26, 2023
1 parent 54eacca commit 6601515
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/client/shadows/dynamicshadowsrender.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 6601515

Please sign in to comment.