aboutsummaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorDmitry Kostenko <codeforsmile@gmail.com>2021-11-03 23:38:27 +0100
committerx2048 <codeforsmile@gmail.com>2022-03-07 23:45:26 +0100
commit4e39cdef946e137519551bc77234bae2ee35a7f3 (patch)
tree4b5dc103a23947e5ace6f245806773df3dcef6b8 /src/client
parent2bba53b2c3f0045c326f6c7578104ffaef53ceac (diff)
downloadminetest-4e39cdef946e137519551bc77234bae2ee35a7f3.tar.gz
minetest-4e39cdef946e137519551bc77234bae2ee35a7f3.tar.bz2
minetest-4e39cdef946e137519551bc77234bae2ee35a7f3.zip
Apply shadow texture to wield-based entities
For example, dropped nodes and items.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/wieldmesh.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/client/wieldmesh.cpp b/src/client/wieldmesh.cpp
index 0a4cb3b86..8b3347df6 100644
--- a/src/client/wieldmesh.cpp
+++ b/src/client/wieldmesh.cpp
@@ -541,9 +541,14 @@ void WieldMeshSceneNode::changeToMesh(scene::IMesh *mesh)
m_meshnode->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, m_lighting);
m_meshnode->setVisible(true);
- // Add mesh to shadow caster
- if (m_shadow)
+ if (m_shadow) {
+ // Add mesh to shadow caster
m_shadow->addNodeToShadowList(m_meshnode);
+
+ // Set shadow texture
+ for (u32 i = 0; i < m_meshnode->getMaterialCount(); i++)
+ m_meshnode->setMaterialTexture(3, m_shadow->get_texture());
+ }
}
void getItemMesh(Client *client, const ItemStack &item, ItemMesh *result)