From 6d9fc9b0b8fe4535e089f068aed3e4dc7aaca228 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Thu, 4 May 2023 16:16:04 +0100 Subject: [PATCH] Use cache index to place shader table values --- src/voxel/brickmap.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/voxel/brickmap.rs b/src/voxel/brickmap.rs index 4e8afbe..8a3dcbf 100644 --- a/src/voxel/brickmap.rs +++ b/src/voxel/brickmap.rs @@ -211,7 +211,7 @@ impl BrickmapManager { self.update_brickgrid_element(context, chunk_idx, brickgrid_element); // Update the shading table - let shading_idx = chunk_idx * 512; + let shading_idx = self.brickmap_cache_idx * 512; self.shading_table.splice( shading_idx..(shading_idx + albedo_data.len()), albedo_data.clone(),