mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Allow server side occlusion culling.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user