From b028e8f913adfa26e5a5f1dd841873b69f6fd6ac Mon Sep 17 00:00:00 2001 From: Moritz Zwerger Date: Sun, 8 Oct 2023 15:24:55 +0200 Subject: [PATCH] occlusion culling: trace x->z->y That should improve cpu caching and improve performance --- .../minosoft/data/world/container/block/SectionOcclusion.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/bixilon/minosoft/data/world/container/block/SectionOcclusion.kt b/src/main/java/de/bixilon/minosoft/data/world/container/block/SectionOcclusion.kt index 70648ad8b..b8b318e01 100644 --- a/src/main/java/de/bixilon/minosoft/data/world/container/block/SectionOcclusion.kt +++ b/src/main/java/de/bixilon/minosoft/data/world/container/block/SectionOcclusion.kt @@ -73,10 +73,10 @@ class SectionOcclusion( if (x > 0) trace(regions, x - 1, y, z, nextId) if (x < ProtocolDefinition.SECTION_MAX_X) trace(regions, x + 1, y, z, nextId) - if (y > 0) trace(regions, x, y - 1, z, nextId) - if (y < ProtocolDefinition.SECTION_MAX_Y) trace(regions, x, y + 1, z, nextId) if (z > 0) trace(regions, x, y, z - 1, nextId) if (z < ProtocolDefinition.SECTION_MAX_Z) trace(regions, x, y, z + 1, nextId) + if (y > 0) trace(regions, x, y - 1, z, nextId) + if (y < ProtocolDefinition.SECTION_MAX_Y) trace(regions, x, y + 1, z, nextId) } private fun floodFill(): ShortArray {