From 3d8719275de52a63b10ec4f45212bfc1c6de14c4 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Sat, 6 May 2023 12:43:40 +0100 Subject: [PATCH] Correctly update brickgrid when brickmaps are empty --- src/voxel/brickmap.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/voxel/brickmap.rs b/src/voxel/brickmap.rs index a79d3fa..7c5670c 100644 --- a/src/voxel/brickmap.rs +++ b/src/voxel/brickmap.rs @@ -229,6 +229,12 @@ impl BrickmapManager { + chunk_y * world_dims[0] + chunk_z * world_dims[0] * world_dims[1]) as usize; + // Don't upload it if it's empty + if albedo_data.is_empty() { + self.update_brickgrid_element(context, chunk_idx, 0); + continue; + } + // Update the brickgrid index let brickgrid_element = ((self.brickmap_cache_idx as u32) << 8) + 4; self.update_brickgrid_element(context, chunk_idx, brickgrid_element);