1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Do not render objects that are invisble into the shadow map

This commit is contained in:
Rising Leaf 2023-08-26 20:12:17 +02:00 committed by GitHub
parent 54eacca287
commit 660151572f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -474,8 +474,8 @@ void ShadowRenderer::renderShadowObjects(
m_driver->setTransform(video::ETS_PROJECTION, light.getProjectionMatrix()); m_driver->setTransform(video::ETS_PROJECTION, light.getProjectionMatrix());
for (const auto &shadow_node : m_shadow_node_array) { for (const auto &shadow_node : m_shadow_node_array) {
// we only take care of the shadow casters // we only take care of the shadow casters and only visible nodes cast shadows
if (shadow_node.shadowMode == ESM_RECEIVE) if (shadow_node.shadowMode == ESM_RECEIVE || !shadow_node.node->isVisible())
continue; continue;
// render other objects // render other objects