]> git.lizzy.rs Git - minetest.git/commitdiff
Fix occlusion culling, again (#4930)
authorlhofhansl <lhofhansl@yahoo.com>
Mon, 19 Dec 2016 05:43:04 +0000 (21:43 -0800)
committerest31 <est31@users.noreply.github.com>
Mon, 19 Dec 2016 05:43:04 +0000 (06:43 +0100)
src/clientmap.cpp

index db71d4b577caed60208c1e18a8a0213f8a11f466..faa1461f643cb8c8697d052435216cf82bf1fdad 100644 (file)
@@ -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,