1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-19 11:15:18 +02:00

Occlusion culling algorithm based on recursive descend (#13104)

Co-authored-by: DS <vorunbekannt75@web.de>
This commit is contained in:
x2048
2023-01-06 22:31:06 +01:00
committed by GitHub
parent 059f62d7d6
commit 2715cc8bf6
11 changed files with 493 additions and 58 deletions

View File

@@ -76,7 +76,7 @@ public:
s32 id
);
virtual ~ClientMap() = default;
virtual ~ClientMap();
bool maySaveBlocks() override
{
@@ -116,6 +116,8 @@ public:
void getBlocksInViewRange(v3s16 cam_pos_nodes,
v3s16 *p_blocks_min, v3s16 *p_blocks_max, float range=-1.0f);
void updateDrawList();
// @brief Calculate statistics about the map and keep the blocks alive
void touchMapBlocks();
void updateDrawListShadow(v3f shadow_light_pos, v3f shadow_light_dir, float radius, float length);
// Returns true if draw list needs updating before drawing the next frame.
bool needsUpdateDrawList() { return m_needs_update_drawlist; }
@@ -136,11 +138,14 @@ public:
f32 getWantedRange() const { return m_control.wanted_range; }
f32 getCameraFov() const { return m_camera_fov; }
void onSettingChanged(const std::string &name);
private:
// update the vertex order in transparent mesh buffers
void updateTransparentMeshBuffers();
// Orders blocks by distance to the camera
class MapBlockComparer
{
@@ -205,4 +210,7 @@ private:
bool m_cache_bilinear_filter;
bool m_cache_anistropic_filter;
u16 m_cache_transparency_sorting_distance;
bool m_new_occlusion_culler;
bool m_enable_raytraced_culling;
};