diff options
| author | Liso <anlismon@gmail.com> | 2021-06-06 18:51:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-06 18:51:21 +0200 |
| commit | c47313db65f968559711ac1b505ef341a9872017 (patch) | |
| tree | 63d9b1b2be512918e2361d96e4fb52ff1ec3f9de /src/client/content_cao.cpp | |
| parent | 46f42e15c41cf4ab23c5ff4cd8a7d99d94d10d7b (diff) | |
| download | minetest-c47313db65f968559711ac1b505ef341a9872017.tar.xz | |
Shadow mapping render pass (#11244)
Co-authored-by: x2048 <codeforsmile@gmail.com>
Diffstat (limited to 'src/client/content_cao.cpp')
| -rw-r--r-- | src/client/content_cao.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp index 2e58e19cf..9216f0010 100644 --- a/src/client/content_cao.cpp +++ b/src/client/content_cao.cpp @@ -24,6 +24,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include <IMeshManipulator.h> #include <IAnimatedMeshSceneNode.h> #include "client/client.h" +#include "client/renderingengine.h" #include "client/sound.h" #include "client/tile.h" #include "util/basic_macros.h" @@ -555,6 +556,9 @@ void GenericCAO::removeFromScene(bool permanent) clearParentAttachment(); } + if (auto shadow = RenderingEngine::get_shadow_renderer()) + shadow->removeNodeFromShadowList(getSceneNode()); + if (m_meshnode) { m_meshnode->remove(); m_meshnode->drop(); @@ -803,10 +807,13 @@ void GenericCAO::addToScene(ITextureSource *tsrc, scene::ISceneManager *smgr) if (m_reset_textures_timer < 0) updateTextures(m_current_texture_modifier); - scene::ISceneNode *node = getSceneNode(); + if (scene::ISceneNode *node = getSceneNode()) { + if (m_matrixnode) + node->setParent(m_matrixnode); - if (node && m_matrixnode) - node->setParent(m_matrixnode); + if (auto shadow = RenderingEngine::get_shadow_renderer()) + shadow->addNodeToShadowList(node); + } updateNametag(); updateMarker(); |
