MoreCulling

MoreCulling

77.1k Downloads

Make glass panes/iron bars cull each other properly when stacked vertically

muzikbike opened this issue ยท 6 comments

commented

Vanilla issue https://bugs.mojang.com/browse/MC-50349 - this has been the case for glass panes since 1.7 and for iron bars since 1.8.

In vanilla, glass panes on top of other glass panes don't cull the other glass panes, and likewise for iron bars. This results in some rather obvious stripes in large sheets formed of the blocks when seen at the correct angles, especially for iron bars.
2023-03-30_06 31 15

It's possible to manually add in cullface arguments to the models in order to have faces be culled, however a perfect solution cannot be reached through this alone. If we assign cullface only to the "post" element, we get this:
2023-03-30_06 32 09

This is obviously incomplete, so we'd want to have the parts extending off of the post also have their tops and bottoms culled. If we add cullface accordingly, they get culled, but another issue arises: they're culled regardless, with no regard for the geometry actually above them, resulting in faces disappearing that we don't want to disappear.
2023-03-30_06 34 33

In the worst case, one single post can cause four adjacent panes to not render their tops if positioned atop a cross:
2023-03-29_19 26 01
2023-03-29_19 26 02
2023-03-29_19 26 25

Continuity has a built-in resource pack which implements cullface for panes, however since it's just a resource pack it's subject to all of the same issues (PepperCode1/Continuity#74). A resource pack cannot fix this issue alone - there needs to be something that takes the actual shape of blocks above it into account, rather than simply their presence.

Here are two resource packs for testing - one which only adds cullface to posts, and another that adds it to the rest of the pane:
pane-post-cull-only.zip
pane-all-cull.zip

commented

I haven't tested this in OptiFine yet. It may already be fixed there, or may previously have been at one point according to this issue: sp614x/optifine#193

commented

Indeed, OptiFine for 1.19.4 gets rid of this issue: we can clearly see the top plane of that pane still exists. This happens for Fast and Fancy connected textures. Fixing this is entirely possible.
2023-03-30_15 30 28

Note: the weirdness of the side textures is due to multiple separate issues.

commented

I'll attempt to add the ability to modify this cullface ;)

commented

Ya I believe I know how to fix this without the optifine jank, ill try to make some time to fix it

commented

This specific issue is now reported under https://bugs.mojang.com/browse/MC-264676.

commented

Don't have enough time to do this, however I think if you split the top part into multiple pieces and only give a cullface to one it might work. Not sure tho