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
This commit is contained in:
embeddedt authored and Jason Mitchell committed 2024-01-06 17:47:16 -08:00
1 parent f760a3e011
commit 71ea27ee3a
1 file changed
+6 -6
@@ -312,27 +312,27 @@ public class ChunkRenderManager<T extends ChunkGraphicsState> 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;
}