stabilize delays of chunks meshes building

This commit is contained in:
MihailRis 2025-12-29 20:41:47 +03:00
parent f47ccd5f30
commit 88544183d0
13 changed files with 335 additions and 191 deletions

View file

@ -17,7 +17,6 @@ class Content;
class Block;
class Chunk;
class Chunks;
class VoxelsVolume;
class ContentGfxCache;
struct UVRegion;
@ -31,9 +30,9 @@ public:
);
~BlocksRenderer();
void build(const Chunk* chunk, const VoxelsVolume& volume);
void build(const Chunk* chunk, const VoxelsRenderVolume& volume);
ChunkMesh render(
const Chunk* chunk, const VoxelsVolume& volume
const Chunk* chunk, const VoxelsRenderVolume& volume
);
ChunkMeshData createMesh();
@ -58,7 +57,7 @@ private:
bool densePass = false;
bool denseRender = false;
const Chunk* chunk = nullptr;
const VoxelsVolume* voxelsBuffer = nullptr;
const VoxelsRenderVolume* voxelsBuffer = nullptr;
const Block* const* blockDefsCache;
const ContentGfxCache& cache;
@ -143,8 +142,6 @@ private:
bool ao
);
bool isOpenForLight(int x, int y, int z) const;
// Does block allow to see other blocks sides (is it transparent)
inline bool isOpen(const glm::ivec3& pos, const Block& def, const Variant& variant) const {
auto vox = voxelsBuffer->pickBlock(