mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Allow server side occlusion culling.
This commit is contained in:
parent
6738c7e9a3
commit
ba4b704ebf
7 changed files with 92 additions and 66 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue