fix: remove .max(0) clamp from z_min — was inflating dirty set to all 20181 keys

Negative world z (below ground) was excluded by the clamp, making the
visible window asymmetrically large. Dirty count now proportional to
actual scroll distance. Frame time dropped from ~13ms to ~8.3ms avg.
This commit is contained in:
2026-03-20 15:31:53 +00:00
parent 0d73311c68
commit 2b8e1c32b9
+1 -1
View File
@@ -447,7 +447,7 @@ pub fn on_camera_z_changed(
let now = Instant::now();
let z_min = (new_camera_z.min(old_camera_z) - 8).max(0);
let z_min = new_camera_z.min(old_camera_z) - 8;
let z_max = new_camera_z.max(old_camera_z);
let mut new_keys: Vec<ChunkLayerKey> = Vec::new();