mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Force-update shadows when the world is changed (#12364)
This commit is contained in:
parent
8b74257bf3
commit
ef22c0206f
3 changed files with 19 additions and 6 deletions
|
@ -530,6 +530,7 @@ void Client::step(float dtime)
|
|||
{
|
||||
int num_processed_meshes = 0;
|
||||
std::vector<v3s16> blocks_to_ack;
|
||||
bool force_update_shadows = false;
|
||||
while (!m_mesh_update_thread.m_queue_out.empty())
|
||||
{
|
||||
num_processed_meshes++;
|
||||
|
@ -556,9 +557,11 @@ void Client::step(float dtime)
|
|||
|
||||
if (is_empty)
|
||||
delete r.mesh;
|
||||
else
|
||||
else {
|
||||
// Replace with the new mesh
|
||||
block->mesh = r.mesh;
|
||||
force_update_shadows = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
delete r.mesh;
|
||||
|
@ -583,6 +586,10 @@ void Client::step(float dtime)
|
|||
|
||||
if (num_processed_meshes > 0)
|
||||
g_profiler->graphAdd("num_processed_meshes", num_processed_meshes);
|
||||
|
||||
auto shadow_renderer = RenderingEngine::get_shadow_renderer();
|
||||
if (shadow_renderer && force_update_shadows)
|
||||
shadow_renderer->setForceUpdateShadowMap();
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue