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:
@@ -447,7 +447,7 @@ pub fn on_camera_z_changed(
|
|||||||
|
|
||||||
let now = Instant::now();
|
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 z_max = new_camera_z.max(old_camera_z);
|
||||||
|
|
||||||
let mut new_keys: Vec<ChunkLayerKey> = Vec::new();
|
let mut new_keys: Vec<ChunkLayerKey> = Vec::new();
|
||||||
|
|||||||
Reference in New Issue
Block a user