diff options
author | x2048 <codeforsmile@gmail.com> | 2023-01-31 17:30:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-31 17:30:59 +0100 |
commit | 69fc20610947610b7829f3bfad82e23ed705b764 (patch) | |
tree | 775cb27a4875a071fccddee87b80730e39ed9b14 /src/client/mesh_generator_thread.h | |
parent | cded6a3945206e51c35adbd063f1aec3a47e310f (diff) | |
download | minetest-69fc20610947610b7829f3bfad82e23ed705b764.tar.xz |
8x block meshes (#13133)
Reduce the number of drawcalls by generating a mesh per 8 blocks (2x2x2). Only blocks with even coordinates (lowest bit set to 0) will get a mesh.
Note: This also removes the old 'loops' algorithm for building the draw list, because it produces visual artifacts and cannot be made compatible with the approach of having a mesh for every 8th block without hurting performance.
Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
Co-authored-by: Lars <larsh@apache.org>
Co-authored-by: sfan5 <sfan5@live.de>
Diffstat (limited to 'src/client/mesh_generator_thread.h')
-rw-r--r-- | src/client/mesh_generator_thread.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/mesh_generator_thread.h b/src/client/mesh_generator_thread.h index cfcb1df09..3097f3704 100644 --- a/src/client/mesh_generator_thread.h +++ b/src/client/mesh_generator_thread.h @@ -28,11 +28,12 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "util/thread.h" #include <vector> #include <memory> +#include <unordered_map> struct QueuedMeshUpdate { v3s16 p = v3s16(-1337, -1337, -1337); - bool ack_block_to_server = false; + std::vector<v3s16> ack_list; int crack_level = -1; v3s16 crack_pos; MeshMakeData *data = nullptr; // This is generated in MeshUpdateQueue::pop() @@ -96,8 +97,8 @@ struct MeshUpdateResult { v3s16 p = v3s16(-1338, -1338, -1338); MapBlockMesh *mesh = nullptr; - u8 solid_sides = 0; - bool ack_block_to_server = false; + std::unordered_map<v3s16, u8> solid_sides; + std::vector<v3s16> ack_list; bool urgent = false; std::vector<MapBlock *> map_blocks; |