From 908fbc895e18d21ea00ae4e69f957534c4cdc0eb Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 19 Dec 2025 22:14:03 +0300 Subject: [PATCH] update target texture detection --- src/graphics/render/BlockWrapsRenderer.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/graphics/render/BlockWrapsRenderer.cpp b/src/graphics/render/BlockWrapsRenderer.cpp index 34b2dba45..419dfc4fd 100644 --- a/src/graphics/render/BlockWrapsRenderer.cpp +++ b/src/graphics/render/BlockWrapsRenderer.cpp @@ -30,13 +30,21 @@ void BlockWrapsRenderer::draw(const BlockWrapper& wrapper) { shader.uniform1i("u_alphaClip", false); util::TextureRegion texRegions[6] {}; + const Texture* texture = nullptr; UVRegion uvRegions[6] {}; for (int i = 0; i < 6; i++) { + if (wrapper.cullingBits & (1 << i) == 0) { + continue; + } auto texRegion = util::get_texture_region(assets, wrapper.textureFaces[i], ""); texRegions[i] = texRegion; uvRegions[i] = texRegion.region; + + if (texture == nullptr) { + texture = texRegion.texture; + } } - batch->setTexture(texRegions[0].texture); + batch->setTexture(texture); const voxel* vox = chunks.get(wrapper.position); if (vox == nullptr || vox->id == BLOCK_VOID) {