1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

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>
This commit is contained in:
x2048 2023-01-31 17:30:59 +01:00 committed by GitHub
parent cded6a3945
commit 69fc206109
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 266 additions and 118 deletions

View file

@ -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;