mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Release shadow mapping resources when not needed (#12497)
This commit is contained in:
parent
b15393c2a5
commit
7c261118e0
5 changed files with 47 additions and 33 deletions
|
@ -472,7 +472,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
|
|||
// pass the shadow map texture to the buffer texture
|
||||
ShadowRenderer *shadow = m_rendering_engine->get_shadow_renderer();
|
||||
if (shadow && shadow->is_active()) {
|
||||
auto &layer = material.TextureLayer[3];
|
||||
auto &layer = material.TextureLayer[ShadowRenderer::TEXTURE_LAYER_SHADOW];
|
||||
layer.Texture = shadow->get_texture();
|
||||
layer.TextureWrapU = video::E_TEXTURE_CLAMP::ETC_CLAMP_TO_EDGE;
|
||||
layer.TextureWrapV = video::E_TEXTURE_CLAMP::ETC_CLAMP_TO_EDGE;
|
||||
|
@ -485,6 +485,7 @@ void ClientMap::renderMap(video::IVideoDriver* driver, s32 pass)
|
|||
}
|
||||
driver->setMaterial(material);
|
||||
++material_swaps;
|
||||
material.TextureLayer[ShadowRenderer::TEXTURE_LAYER_SHADOW].Texture = nullptr;
|
||||
}
|
||||
|
||||
v3f block_wpos = intToFloat(descriptor.m_pos * MAP_BLOCKSIZE, BS);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue