From da1fc9a5366b9ceace6d829783a9a56545616158 Mon Sep 17 00:00:00 2001 From: Desour Date: Sun, 25 Aug 2024 10:21:50 +0200 Subject: [PATCH] Meshgen: Don't get lights for not drawn solid faces `drawCuboid()` doesn't call the face lighter function for masked faces, so we don't need these values. This is for performance. --- src/client/content_mapblock.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/client/content_mapblock.cpp b/src/client/content_mapblock.cpp index c351c4b80..1de36c9c5 100644 --- a/src/client/content_mapblock.cpp +++ b/src/client/content_mapblock.cpp @@ -463,6 +463,8 @@ void MapblockMeshGenerator::drawSolidNode() if (data->m_smooth_lighting) { LightPair lights[6][4]; for (int face = 0; face < 6; ++face) { + if (mask & (1 << face)) + continue; for (int k = 0; k < 4; k++) { v3s16 corner = light_dirs[light_indices[face][k]]; lights[face][k] = LightPair(getSmoothLightSolid(