Skip to content

Commit 24edfb7

Browse files
lhofhanslest31
authored andcommitted
Fix occlusion culling, again (#4930)
1 parent e4f7ce1 commit 24edfb7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/clientmap.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,10 @@ void ClientMap::updateDrawList(video::IVideoDriver* driver)
301301
float endoff = -BS * MAP_BLOCKSIZE * 1.732050807569;
302302
v3s16 spn = cam_pos_nodes;
303303
s16 bs2 = MAP_BLOCKSIZE / 2 + 1;
304-
u32 needed_count = 1;
304+
// to reduce the likelihood of falsely occluded blocks
305+
// require at least two solid blocks
306+
// this is a HACK, we should think of a more precise algorithm
307+
u32 needed_count = 2;
305308
if (occlusion_culling_enabled &&
306309
// For the central point of the mapblock 'endoff' can be halved
307310
isOccluded(this, spn, cpn,

0 commit comments

Comments
 (0)