From 593c52f8c497d3d46cc2fa699d98e104a64fc421 Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Thu, 12 Oct 2023 19:33:17 -0400 Subject: [PATCH] Make Sodium's block occlusion cache behave more similarly to vanilla --- .../client/render/occlusion/BlockOcclusionCache.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/me/jellysquid/mods/sodium/client/render/occlusion/BlockOcclusionCache.java b/src/main/java/me/jellysquid/mods/sodium/client/render/occlusion/BlockOcclusionCache.java index b1b440f70..0cf6170e8 100644 --- a/src/main/java/me/jellysquid/mods/sodium/client/render/occlusion/BlockOcclusionCache.java +++ b/src/main/java/me/jellysquid/mods/sodium/client/render/occlusion/BlockOcclusionCache.java @@ -46,12 +46,21 @@ public boolean shouldDrawSide(BlockState selfState, BlockView view, BlockPos pos } if (selfShape.isEmpty()) { + // Upstream Sodium only returns true under stricter conditions than this, in order to cull faces in + // unusual block arrangements like a potted cacti under a solid block. + // However, that fix has the side effect of causing block models with improperly specified cullfaces + // to not render sometimes, and also breaks powder snow culling on 1.17+. + // It's not clear that the stricter check provides a significant performance uplift, so we err + // on the side of compatibility and use the same weaker check as vanilla. + return true; + /* if (adjShape.isEmpty()){ return true; //example: top face of potted plants if top slab is placed above } else if (!adjState.isSideSolid(view,adjPos,facing.getOpposite(), SideShapeType.FULL)){ return true; //example: face of potted plants rendered if top stair placed above } + */ } return this.calculate(selfShape, adjShape);