diff options
author | x2048 <codeforsmile@gmail.com> | 2022-05-26 22:28:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-26 22:28:34 +0200 |
commit | ef22c0206f225dbccd67bff9fb888867c63039b3 (patch) | |
tree | d83e1f33bbb2aee1da256c853ea49e197fb3f5f2 /src/client/client.cpp | |
parent | 8b74257bf3cbb54e78614ac6aaaba79adf75cc8e (diff) | |
download | minetest-ef22c0206f225dbccd67bff9fb888867c63039b3.tar.gz minetest-ef22c0206f225dbccd67bff9fb888867c63039b3.tar.bz2 minetest-ef22c0206f225dbccd67bff9fb888867c63039b3.zip |
Force-update shadows when the world is changed (#12364)
Diffstat (limited to 'src/client/client.cpp')
-rw-r--r-- | src/client/client.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/client/client.cpp b/src/client/client.cpp index 8ab96b7d1..e078dc530 100644 --- a/src/client/client.cpp +++ b/src/client/client.cpp @@ -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(); } /* |