1
0
Fork 0
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:
x2048 2022-05-26 22:28:34 +02:00 committed by GitHub
parent 8b74257bf3
commit ef22c0206f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 6 deletions

View file

@ -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();
}
/*