aboutsummaryrefslogtreecommitdiff
path: root/src/client/content_cao.cpp
diff options
context:
space:
mode:
authorx2048 <codeforsmile@gmail.com>2022-07-09 22:26:39 +0200
committerGitHub <noreply@github.com>2022-07-09 22:26:39 +0200
commit7c261118e06c630ea9ad00f20d7005b8edc108dd (patch)
tree44a2b6be86343cb5b157f3dfe8570a89b7b15ea1 /src/client/content_cao.cpp
parentb15393c2a5e43e5493c767877cf48b1a510736d6 (diff)
downloadminetest-7c261118e06c630ea9ad00f20d7005b8edc108dd.tar.xz
Release shadow mapping resources when not needed (#12497)
Diffstat (limited to 'src/client/content_cao.cpp')
-rw-r--r--src/client/content_cao.cpp11
1 files changed, 0 insertions, 11 deletions
diff --git a/src/client/content_cao.cpp b/src/client/content_cao.cpp
index 32c1bb4a8..3126ee5e8 100644
--- a/src/client/content_cao.cpp
+++ b/src/client/content_cao.cpp
@@ -1318,12 +1318,6 @@ void GenericCAO::updateTextures(std::string mod)
m_previous_texture_modifier = m_current_texture_modifier;
m_current_texture_modifier = mod;
- video::ITexture *shadow_texture = nullptr;
- if (auto shadow = RenderingEngine::get_shadow_renderer())
- shadow_texture = shadow->get_texture();
-
- const u32 TEXTURE_LAYER_SHADOW = 3;
-
if (m_spritenode) {
if (m_prop.visual == "sprite") {
std::string texturestring = "no_texture.png";
@@ -1334,7 +1328,6 @@ void GenericCAO::updateTextures(std::string mod)
m_spritenode->getMaterial(0).MaterialTypeParam = 0.5f;
m_spritenode->setMaterialTexture(0,
tsrc->getTextureForMesh(texturestring));
- m_spritenode->setMaterialTexture(TEXTURE_LAYER_SHADOW, shadow_texture);
// This allows setting per-material colors. However, until a real lighting
// system is added, the code below will have no effect. Once MineTest
@@ -1370,7 +1363,6 @@ void GenericCAO::updateTextures(std::string mod)
material.MaterialType = m_material_type;
material.MaterialTypeParam = 0.5f;
material.TextureLayer[0].Texture = texture;
- material.TextureLayer[TEXTURE_LAYER_SHADOW].Texture = shadow_texture;
material.setFlag(video::EMF_LIGHTING, true);
material.setFlag(video::EMF_BILINEAR_FILTER, false);
material.setFlag(video::EMF_BACK_FACE_CULLING, m_prop.backface_culling);
@@ -1421,7 +1413,6 @@ void GenericCAO::updateTextures(std::string mod)
material.setFlag(video::EMF_BILINEAR_FILTER, false);
material.setTexture(0,
tsrc->getTextureForMesh(texturestring));
- material.setTexture(TEXTURE_LAYER_SHADOW, shadow_texture);
material.getTextureMatrix(0).makeIdentity();
// This allows setting per-material colors. However, until a real lighting
@@ -1448,7 +1439,6 @@ void GenericCAO::updateTextures(std::string mod)
auto& material = m_meshnode->getMaterial(0);
material.setTexture(0,
tsrc->getTextureForMesh(tname));
- material.setTexture(TEXTURE_LAYER_SHADOW, shadow_texture);
// This allows setting per-material colors. However, until a real lighting
// system is added, the code below will have no effect. Once MineTest
@@ -1473,7 +1463,6 @@ void GenericCAO::updateTextures(std::string mod)
auto& material = m_meshnode->getMaterial(1);
material.setTexture(0,
tsrc->getTextureForMesh(tname));
- material.setTexture(TEXTURE_LAYER_SHADOW, shadow_texture);
// This allows setting per-material colors. However, until a real lighting
// system is added, the code below will have no effect. Once MineTest