mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-05 19:31:04 +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:
parent
cded6a3945
commit
69fc206109
14 changed files with 266 additions and 118 deletions
|
@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include <array>
|
||||
#include <vector>
|
||||
#include "irrlichttypes.h"
|
||||
#include "irr_v3d.h"
|
||||
#include <S3DVertex.h>
|
||||
#include "client/tile.h"
|
||||
|
||||
|
@ -40,9 +41,11 @@ struct MeshCollector
|
|||
// bounding sphere radius and center
|
||||
f32 m_bounding_radius_sq = 0.0f;
|
||||
v3f m_center_pos;
|
||||
v3f offset;
|
||||
|
||||
// center_pos: pos to use for bounding-sphere, in BS-space
|
||||
MeshCollector(const v3f center_pos) : m_center_pos(center_pos) {}
|
||||
// offset: offset added to vertices
|
||||
MeshCollector(const v3f center_pos, v3f offset = v3f()) : m_center_pos(center_pos), offset(offset) {}
|
||||
|
||||
// clang-format off
|
||||
void append(const TileSpec &material,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue