summaryrefslogtreecommitdiff
path: root/src/clientmap.cpp
diff options
context:
space:
mode:
authorlhofhansl <lhofhansl@yahoo.com>2016-12-18 21:43:04 -0800
committerest31 <est31@users.noreply.github.com>2016-12-19 06:43:04 +0100
commit24edfb77afbb631cb83d26a095b609850f997e5c (patch)
tree79ffb22ace61f691d263a3a3e4f03ed9b9efe1c9 /src/clientmap.cpp
parente4f7ce1985bda1c37b62f24d028828c5d3851ca2 (diff)
downloadminetest-24edfb77afbb631cb83d26a095b609850f997e5c.tar.gz
minetest-24edfb77afbb631cb83d26a095b609850f997e5c.tar.bz2
minetest-24edfb77afbb631cb83d26a095b609850f997e5c.zip
Fix occlusion culling, again (#4930)
Diffstat (limited to 'src/clientmap.cpp')
-rw-r--r--src/clientmap.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/clientmap.cpp b/src/clientmap.cpp
index db71d4b57..faa1461f6 100644
--- a/src/clientmap.cpp
+++ b/src/clientmap.cpp
@@ -301,7 +301,10 @@ void ClientMap::updateDrawList(video::IVideoDriver* driver)
float endoff = -BS * MAP_BLOCKSIZE * 1.732050807569;
v3s16 spn = cam_pos_nodes;
s16 bs2 = MAP_BLOCKSIZE / 2 + 1;
- u32 needed_count = 1;
+ // to reduce the likelihood of falsely occluded blocks
+ // require at least two solid blocks
+ // this is a HACK, we should think of a more precise algorithm
+ u32 needed_count = 2;
if (occlusion_culling_enabled &&
// For the central point of the mapblock 'endoff' can be halved
isOccluded(this, spn, cpn,