diff options
author | Lars Hofhansl <larsh@apache.org> | 2017-02-27 23:06:15 -0800 |
---|---|---|
committer | Auke Kok <sofar+github@foo-projects.org> | 2017-03-11 18:11:19 -0800 |
commit | ba4b704ebf24952ab9a84c914b8ad6c45dabfaba (patch) | |
tree | d0e8d00948e40dbf20c9f3eb009ba494fb551648 /src/clientiface.cpp | |
parent | 6738c7e9a310514fca7d4ddb685800391756626b (diff) | |
download | minetest-ba4b704ebf24952ab9a84c914b8ad6c45dabfaba.tar.gz minetest-ba4b704ebf24952ab9a84c914b8ad6c45dabfaba.tar.bz2 minetest-ba4b704ebf24952ab9a84c914b8ad6c45dabfaba.zip |
Allow server side occlusion culling.
Diffstat (limited to 'src/clientiface.cpp')
-rw-r--r-- | src/clientiface.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/clientiface.cpp b/src/clientiface.cpp index 0eb68c9c1..76a34c392 100644 --- a/src/clientiface.cpp +++ b/src/clientiface.cpp @@ -197,6 +197,9 @@ void RemoteClient::GetNextBlocks ( s32 nearest_sent_d = -1; //bool queue_is_full = false; + const v3s16 cam_pos_nodes = floatToInt(camera_pos, BS); + const bool occ_cull = g_settings->getBool("server_side_occlusion_culling"); + s16 d; for(d = d_start; d <= d_max; d++) { /* @@ -298,6 +301,11 @@ void RemoteClient::GetNextBlocks ( if(block->getDayNightDiff() == false) continue; } + + if (occ_cull && !block_is_invalid && + env->getMap().isBlockOccluded(block, cam_pos_nodes)) { + continue; + } } /* |