diff options
author | x2048 <codeforsmile@gmail.com> | 2023-01-06 22:31:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-06 22:31:06 +0100 |
commit | 2715cc8bf68a2cc8cd583cd5b0bb732ee13a1b49 (patch) | |
tree | cd9c735604cc8ca5c7b6a84cdf5e44058a9d0e11 /src/client/game.cpp | |
parent | 059f62d7d60b0aab9af47740f5d5101aa25b7077 (diff) | |
download | minetest-2715cc8bf68a2cc8cd583cd5b0bb732ee13a1b49.tar.xz |
Occlusion culling algorithm based on recursive descend (#13104)
Co-authored-by: DS <vorunbekannt75@web.de>
Diffstat (limited to 'src/client/game.cpp')
-rw-r--r-- | src/client/game.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp index 078998bf7..3f76d2e05 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -696,6 +696,7 @@ struct GameRunData { float damage_flash; float update_draw_list_timer; + float touch_blocks_timer; f32 fog_range; @@ -4030,6 +4031,9 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime, changed much */ runData.update_draw_list_timer += dtime; + runData.touch_blocks_timer += dtime; + + bool draw_list_updated = false; float update_draw_list_delta = 0.2f; @@ -4041,6 +4045,12 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime, runData.update_draw_list_timer = 0; client->getEnv().getClientMap().updateDrawList(); runData.update_draw_list_last_cam_dir = camera_direction; + draw_list_updated = true; + } + + if (runData.touch_blocks_timer > update_draw_list_delta && !draw_list_updated) { + client->getEnv().getClientMap().touchMapBlocks(); + runData.touch_blocks_timer = 0; } if (RenderingEngine::get_shadow_renderer()) { |