From 71ea27ee3ae460b69d525e273e78b34eb00e5f28 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Sat, 30 Dec 2023 22:07:44 -0500 Subject: [PATCH] Apply epsilons to block face culling checks Inspired by https://github.com/CaffeineMC/sodium-fabric/commit/c344269368d6ea04d8f9affd1d6aec287aec09c2 The change also makes sense, because block geometry can extend some distance out of a chunk's strict bounds --- .../client/render/chunk/ChunkRenderManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/ChunkRenderManager.java b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/ChunkRenderManager.java index ddbc42c13..e88babb11 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/ChunkRenderManager.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/ChunkRenderManager.java @@ -312,27 +312,27 @@ public class ChunkRenderManager implements ChunkSt // Always render groups of vertices not belonging to any given face int visibleFaces = ChunkFaceFlags.UNASSIGNED; - if (this.cameraY > bounds.y1) { + if (this.cameraY > (bounds.y1 - 3)) { visibleFaces |= ChunkFaceFlags.UP; } - if (this.cameraY < bounds.y2) { + if (this.cameraY < (bounds.y2 + 3)) { visibleFaces |= ChunkFaceFlags.DOWN; } - if (this.cameraX > bounds.x1) { + if (this.cameraX > (bounds.x1 - 3)) { visibleFaces |= ChunkFaceFlags.EAST; } - if (this.cameraX < bounds.x2) { + if (this.cameraX < (bounds.x2 + 3)) { visibleFaces |= ChunkFaceFlags.WEST; } - if (this.cameraZ > bounds.z1) { + if (this.cameraZ > (bounds.z1 - 3)) { visibleFaces |= ChunkFaceFlags.SOUTH; } - if (this.cameraZ < bounds.z2) { + if (this.cameraZ < (bounds.z2 + 3)) { visibleFaces |= ChunkFaceFlags.NORTH; }